Answer to Question #51470 in C++ for Josh
Declare variables to hold the following fields.
Year
State
Population
Violent crime total
Murders
Rape
Robbery
Assault
Property crime total
Burglary
Larceny-theft
Motor vehicle theft
Note other variables may be needed.
Use string types for the year and state and the integer type for the remaining record field variables.
Output your Welcome message. Remember to use your name in the message.
Use nested loops.
The outer loop should do the following:
Prompt for the name of the state to display or the sentinel value “quit”.
Use the appropriate console input statement to read state names that may include spaces e.g., New York.
Check if the sentinel value “quit” has been entered, if it has then exit the outer loop and terminate the program.
Otherwise, open the crime statistics file. See the “crimesbystate1.txt” file.
Check if the file has been opened successfully. Issue an error message and abort the program if there is an error.
0
Answer in progress...
Need a fast expert's response?
Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Learn more about our help with Assignments:
C++
Comments
Leave a comment