computer science programming
For this assignment, prepare two related programs as .cpp files and submit them in a single zipped file.
Program #1 Instructions:
- Write a simple program to validate passing by value and passing by reference.
- Initialize a variable and display its value.
- Pass the variable by value to a function. Change the value of the variable in the pass by value function. Display the modified value inside the function.
- After the pass by value function returned, display the value again in the main function.
- Pass the same variable, now passing by reference to another function. Change the value of the variable in the pass by reference function. Display the modified value inside the function.
- After the pass by reference function returned, display the value again in the main function.
- See the sample code below for an example of how your program output should look:
Variable name has the value "Barry"
calling pass by value
Parameter now has the value "Thomas"pass by value returned
Variable name has the value "Barry"calling pass by references
Parameter now has the value "James"call by reference returned
Variable name has the value "James"
- Name the project: PassingByValueReference.cpp
Program #2 Instructions:
- Write another simple Address program to print the value of the memory addresses of the variables listed below:
- a char
- a string
- an array of integers
- an integer
- a double
- See the sample code below for an example of how your program output should look:
Integer has memory address 0x434232
String has memory address 0x434234
Array has memory address 0x434320
Array[1] has memory address 0x434322
Array[2] has memory address 0x434324
Array[3] has memory address 0x434326
etc...
etc...
- Name the project: Address.cpp
Place your two .cpp files in a single zipped folder.
9 years ago 5
Answer(1)
Purchase the answer to view it
NOT RATED
- cpp_files.rar
- sample_outputs.docx
Bids(1)
other Questions(10)
- BUS 210 Week 2 CheckPoint- Business Organization
- Case Study 2: HIPAA and IT Audits
- final help due in 30 min
- It is a physics lab 101 - writing-report
- Select one organization from each of the organizational types addressed in the Week Two readings—manufacturing and the service industry. Write a 700- to 1,050-word paper that includes the following: Evaluates the impact that innovation, design, and creati
- How would you cite this case: Michele Greear, et.al., plaintiffs, vs. C.E. electronics, Inc., et.al., defendants, decided in the United...
- AED 202 Week 6 CheckPoint Reading and Writing Strategies
- A+ Answers
- diabetes
- James T. Johnson is a 24-year-old construction worker who lives at home with his mother. During the week, he goes to work on time, does his wor