subject

Create (and update) a program that will manipulate variables via their value and their memory. ---Programs
Program 1 - Create an array of 15 ints and place a random number into each slot in the array. Then loop through that array and print out the value and memory address of each item.
Program 2 - Create a new array of 15 ints and place a random number into each slot in the array. Create a function with parameters for both a int and an int pointer. This function should print out the data attached to each item as well as the memory address of each item. Loop through the array and pass each item in the array to this function.
Note: This will require you to pass the same variable to the same function twice. Once by value and once by address;
Program 3 -
Part-1
Create a struct of cars that holds a char array of size 32 for a make, a char array of size 32 for a model, an enum for color (this will need to be created), and an int for year. Create an statically sized array of 3 cars and ask the user to input the make, model, color, year, and mileage. The color question should provide a list of color options that links to the color enum. The mileage should be a random number. Once that is done, loop through the structs and display all the data to the screen.
Example Output
Car 1 – 2003 Gray Ford Mustang with 4,000 miles
Car 2 – 2016 White Ford Fusion with 567 miles
Car 3 - 2019 Silver Tesla Cybertruck with 127,204 miles
Part 2
Add a menu that provides an option to repaint a car after they have been created. You will need to implement the repaintCar function.
1
void repaintCar(Car* car, Color color);
Part 3
Let's move our display logic into a separate function. We will make two versions. One will use a static Car and the other will use a Car pointer. Implement both functions and print the cars out to the console using both versions.
1
void printCar(Car c);
2
void printCarPointer(Car* c);
C/C++
Example Output
Car 1 – 2003 Gray Ford Mustang with 4,000 miles
Car 2 – 2016 White Ford Fusion with 567 miles
Car 3 - 2019 Silver Tesla Cybertruck with 127,204 miles
Car* 1 – 2003 Gray Ford Mustang with 4,000 miles
Car* 2 – 2016 White Ford Fusion with 567 miles
Car* 3 - 2019 Silver Tesla Cybertruck with 127,204 miles
Part 4
We need to add the ability to add mileage to the car. Create a function that will work with the for loop below to add mileage to the car.
1
for(int i = 0; i < 3; i++){
2
addMileage(&cars[i], 500);
3
}
C/C++

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 02:30
These factors limit the ability to attach files to e-mail messages. location of sender recipient's ability to open file size of file type of operating system used
Answers: 2
question
Computers and Technology, 23.06.2019 11:30
Me dangers of social media and the internetexplain what each means: 1) social media and phones have become an addiction.2) outside people have access to you all the time.3) cyberstalking4) cyberbullying5) catphishing6) viruses7) identity theft8) credit card fraud9) hacking10) money schemes
Answers: 1
question
Computers and Technology, 24.06.2019 12:00
Which spreadsheet operation does a look function perform?
Answers: 1
question
Computers and Technology, 24.06.2019 19:20
Kiesha has a worksheet with a range of cells using the following columns: name, score, group, study group, and date. kiesha needs to sort the worksheet on the date field. which option she use to most efficiently complete this task ? a use the cut and paste option to reorganize the data to fit that order b use the filter function to organize the data based on the date c use the order function to organize the data based on the date d use the sort function to organize the data based on date order
Answers: 3
You know the right answer?
Create (and update) a program that will manipulate variables via their value and their memory. ---P...
Questions
question
History, 15.01.2021 18:20
question
Mathematics, 15.01.2021 18:20
question
Mathematics, 15.01.2021 18:20
question
Mathematics, 15.01.2021 18:20
question
Mathematics, 15.01.2021 18:20