Question: 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

 I got this assignment in my computer science class. My teacher

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!