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

In C++ One of the things we rely on computers to do for us is to store informati

ID: 3833254 • Letter: I

Question

In C++

One of the things we rely on computers to do for us is to store information. We keep files, movies and music (all legally obtained of course...), and a host of data to help us keep organized.

This week your challenge (the last one!) is to make a program that keeps a collection of lists. You'll manage a grocery, hardware store, and chore list all in the same program. You'll use files to store those lists so that they're somewhat permanent, and vectors to read those lists in to display for the user.

Your list manager will minimally hit the following benchmarks:

Menus! Control the interface

Select a list to edit

Quit the program

Allow users to add or remove items

Functions!

Entering items to add to a list

Deleting items from a list

Menus

File Operations! Read and use files

grocery

hardware store

chores

Loops!

Add as many items as necessary

Delete as many items as necessary

Move between lists as often as my little heart desires

Vectors!

Read items from files into vectors

Add items to lists - who's length is unknown

Delete selected items from lists

Display lists in a way that makes sense to a user

Good User Design

Make sure I know what's going on as the user. That means good user prompting, control of the outputs to the screen, clearing where necessary, and keeping the user engaged as they edit those lists!

Explanation / Answer

#include "stdafx.h" #include #include using namespace std; struct MovieData { string title; string director; int year_released; int running_time; int production_cost; int first_year_revenue; }; // Function prototypes MovieData getMovieData(); void printMovieData(MovieData *); int main() { // Variables MovieData m1, m2; MovieData *ptr1, *ptr2; ptr1 = &m1; ptr2 = &m2; // Call getMovieData function to get information for both movies m1 = getMovieData(); m2 = getMovieData(); // Call printMoviedata function to print information for both movies printMovieData(ptr1); cout