Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Reset Write multiple if statements: If carYear is before 1968, print \"Probably

ID: 3879591 • Letter: R

Question

Reset Write multiple if statements: If carYear is before 1968, print "Probably has few safety features (without quotes) If after 1969, print "Probably has head rests." If after 1992, print "Probably has electronic stability control. If after 2001, print 'Prodably has tire pressure monitor End each phrase with period and newline. Ex carYear 1995 prints: Probably has head rests. Probably has electronic stability control. #include 2 using nanespace std a int main() ( 7 carYear 1970 5 int carYear Your solution goes here 10 1 return

Explanation / Answer

#include <iostream>

using namespace std;

int main() {

int carYear;

carYear = 1970;

if(carYear < 1968)

cout << "Probably has few safety features." << endl;

if(carYear > 1969)

cout << "Probably has head rests." << endl;

if(carYear > 1992)

cout << "Probably has electronic stability control." << endl;

if(carYear > 2001)

cout << "Probably has tire-pressure monitor." << endl;

return 0;

}

/*SAMPLE OUTPUT

for carYear = 1995

Probably has head rests.

Probably has electronic stability control.

for carYear = 1970

Probably has head rests.

*/

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote