Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I have this two parts quistion that I would like an answer for. Than you Part1: Write a program that performs the following: Presents the

I have this two parts quistion that I would like an answer for.

Than you

Part1:

Write a program that performs the following:

Presents the user a menu where they choose between:Add a new student to the class

Prompts for first name, last name

If assignments already exist, ask user for new students scores to assignments

Assign grades for a new assignment

If students already exist, prompt user with student name, ask them for score

Students created after assignment will need to have score provided

List one student, displaying all their grades and their course average

Prompt user for student, telling them which inputs are valid

If no students and/or no assignments, tell user to try after data input

List all the scores for a chosen assignment

Prompt user for assignment, telling them which options are valid

includes class average

if no valid assignments and/or students, tell user to try after data input

Display all grades currently contained in the gradebook

If no students, tell user gradebook is empty

Exit the program

Return to step 1

For your program you will be using an array (size: 10 elements) of the Student struct, which contains First Name, Last Name (char arrays or strings), and 10 assignment scores (double). Keep track the number of students and number of assignments with variables (might need to pass them to functions as arguments). If the user tries to add students or assignments when they are already full, they should get an error message.

Input should accept either a single lowercase char or an integer, prompts should tell user what to enter.

Points:

2 - Documentation, readability, format

2 - Filename and Header

2 - Output testing

2 - Proper program flow (conditions, loops, functions, etc)

2 - Proper use of structs

Header

//Author: Mehdi Peiravi (your name)

//CPSC 121 Lab 5

// (Current Date)

Filename

lab5.cpp

For example, my assignment would be named MayElab5.cpp

-----------------------------

part2:

We want to enable the user to load data in from a file named scores.txt when theyre starting the program, or allow them to proceed with no students or assignments.

At the menu, we also want to give the user the option at the menu to save the data currently stored in the array to a file named scores.txt

scores.txt format:

4//Number of students

3//Number of assignments

Hannah Montana 83.6 79.4 91.3//One student per following line

Joe Bigsworth 90.0 0 83.5

Oberyn Martell 95.4 84.3 73.9

Ned Stark 79.8 86.5 91.3

Points:

2 - File output

2 - File input

2 - Documentation, readability, format

2 - Filename and Header

2 - Proper program flow (conditions, loops, functions, etc)

2 - Output Testing

2 - Proper use of structs

Header

//Author: Mehdi Peiravi (your name)

//CPSC 121 Lab 5

// (Current Date)

Filename

lab5.cpp

For example, my assignment would be named MayElab5.cpp

Thank You.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Basics Computer EngineeringInformation Warehouse Basics From Science

Authors: Odiljon Jakbarov ,Anvarkhan Majidov

1st Edition

620675183X, 978-6206751830

More Books

Students also viewed these Databases questions