Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I got this assignment in my computer science class. My teacher was very vague about what she wanted and I was wanting to make sure

image text in transcribed

I got this assignment in my computer science class. My teacher was very vague about what she wanted and I was wanting to make sure what I wrote below for the sample output is correct. Also, this is my first assignment using Java. Could you tell me how I would do the first line, how to create a reference to an integer and print the address. I've only learned C++ and part of this assignment is to learn Java, which after 2 hours of youtube videos I'm still not 100% sure. I'm also not 100% that my sample output is correct, after googling some it seems this is C code, and I believe I figured out the output. Thanks!

CS351 Programming Languages Ilomeworle #4 Due Friday 3/2 at 1 PM ross.CPP.java Rewrite the program below using pointers in C++ and reference types in Java, Add a Conment with your name as the first line. Name your suree cocle files using your lastname. Upload yr source cente Tiles to Cugar Courses using the CH and the Java link, respectively. Your Dreams must compile and work correctly on empress to receive credit. Part of ossignment, is hinding how to ievo con rimpress, #include int j, k: int *pte: int main() j = 1; k-2: ptr = Gk; printf(" "); printf ("S has the value 8d and is stored at tp ", 3. &9): printf ("* has the value 4d and is stored at Sp ", X, 4k): printf ("ptr has the value ip and is stored at pla", ptr, optr): printf ("The value of the integer pointed to by ptr As d ", *ptr): return 0; Sample Output ? Jhes the value 1 and 13 stored at / memory adversar. R. - Pointers k hos the value 2 and is stered at // remony address of K P+r hos the volum 2 and is stored at // memory address of we The value of the integer ponted to by ptr is 2

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

4. How has e-commerce affected business-to-business transactions?

Answered: 1 week ago