Professional Documents
Culture Documents
Assignment Write A Program That Uses A Structure T...
Assignment Write A Program That Uses A Structure T...
My courses
My books My folder Career Life
home / study / engineering / computer science / computer science questions and answers / assignment write a program that uses a structure to st…
Question: Assignment
Write a program that uses a structure to store tra… Post a question
Answers from our experts for your tough
homework questions
The program should prompt for each of the 3 months for each
bridge, for example: 1st Edition 5th Edition 16th Edition
Enter month 1 traffic across the Golden Gate Bridge:
View all solutions
Enter month 1 traffic across the Bay Bridge:
...
Then, output each of the averages and the highest single traffic
count.
In C++ Please. Thank you!
Expert Answer
#include <iostream>
double goldenGate,bay,sanMateo;
};
int main()
int i;
for(i=0;i<3;i++) //taking input for 3 months
cout << "Enter month " << i+1 << " traffic across
the Golden Gate bridge: "; //input prompt
cout << "Enter month " << i+1 << " traffic across
the Bay bridge: "; //input prompt
cin >> months[i].bay; //input
cout << "Enter month " << i+1 << " traffic across
the San Mateo bridge: "; //input prompt
double
goldenGate=0,bay=0,sanMateo=0,max=months[0].goldenGate;
goldenGate+=months[i].goldenGate;
bay+=months[i].bay;
sanMateo+=months[i].sanMateo;
if(months[i].goldenGate>max)
max=months[i].goldenGate;
if(months[i].bay>max)
max=months[i].bay;
if(months[i].sanMateo>max)
max=months[i].sanMateo;
//output
return 0;
Output:
Comment
Q: C++ Problem
Write a c++ program that uses a structure to store
traffic counts for three of the area's bridges for a
three month
period.
For each of three months, track the
following:
Total traffic across the Brooklyn Bridge
Total traffic
across the Queensboro Bridge
Total traffic across the George Washington
bridge
The program should have an array
of three structures to
hold...
A: See answer
Q: Assignment Write a program that uses a structure to store traffic counts for three of the area's trans-bay bridges for a
three month period. For each of three months, track the following: • Total traffic across the Golden Gate bridge •
Total traffic across the Bay Bridge • Total traffic across the San Mateo bridge The program should have an array of
three structures to hold traffic...
A: See answer
Q: C++ Problem
Write a c++ program that uses a structure to store
traffic counts for three of the area's bridges for a
three month
period.
For each of three months, track the
following:
Total traffic across the Brooklyn Bridge
Total traffic
across the Queensboro Bridge
Total traffic across the George Washington
bridge
The program should have an array
of three structures to
hold...
A: See answer
COMPANY LEGAL & POLICIES CHEGG PRODUCTS AND SERVICES CHEGG NETWORK CUSTOMER SERVICE
About Chegg Advertising Choices Cheap Textbooks Chegg Math Solver EasyBib Customer Service
Chegg For Good Cookie Notice Chegg Coupon Mobile Apps Internships.com Give Us Feedback
College Marketing General Policies Chegg Play Sell Textbooks Thinkful Manage Subscription
Corporate Development Intellectual Property Rights Chegg Study Help Solutions Manual
Investor Relations Terms of Use College Textbooks Study 101
Jobs Global Privacy Policy eTextbooks Textbook Rental
Join Our Affiliate Program DO NOT SELL MY INFO Flashcards Used Textbooks
Media Center Honor Code Learn Digital Access Codes
Site Map Honor Shield Uversity Chegg Life
Chegg Writing