TPS 10: Structs I
- Due Apr 7, 2021 by 10am
- Points 1
- Submitting a file upload
- File Types doc and docx
- Available after Apr 7, 2021 at 9am
Here's the program that defines a struct to hold information about a car. Fill in as many blanks as you can.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
//============================================================================== // File: tps10.cpp // Author: Hank Feild // Date: 07-Apr-2021 // Purpose: Demonstrates using a struct. //============================================================================== #include <iostream> using namespace std; struct Car { string make, model; int year, miles; bool has4WheelDrive; }; int main(){ // Create in instace of Car to capture a 2016 Subaru Forester with // 50,132 miles and 4-wheel drive. ____ car; car._____ = "Subaru"; car._____ = "Forester"; ____.year = 2016; ____.miles = 50132; ____._____ = true; // Print the info back out in this format: // <year> <make> <model> with <miles> miles and <no?> 4-wheel drive cout << ________ << " " << ________ << " " << _______ << " with " << ______ << " miles and "; if(!________){ cout << "no "; } cout << "4-wheel drive" << endl; return 0; } |
After we've completed the group share portion, upload a copy of your updated TPS document.