Question

In C++, write a complete program that receives a series of student records from the keyboard...

In C++, write a complete program that receives a series of student records from the keyboard and stores them in three parallel arrays named studentID and courseNumber and grade. All arrays are to be 100 elements. The studentID array is to be of type int and the courseNumber and grade arrays are to be of type string.

The program should prompt for the number of records to be entered and then receive user input on how many records are to be entered. That value should be used in an input loop to receive the series of records and store them in the parallel arrays.

Add a function to printout all records stored in the array. Only print records that were input from the keyboard. Much of the arrays will be unused. Add another function to search the arrays using a specific student ID and display the student's ID, course number, and grade wherever found, OR the message "<student ID> doesn't exist in array

Add code in main to print all records and prompt a user to enter a studentID and search for it in the arrays. Test both possible outcomes.

Sample trace:

Enter the number of records to be input : 6

Enter record 1 (student ID, Course number and grade) : 12 COSC175 A

Enter record 2 (student ID, Course number and grade) : 15 COSC175 B

Enter record 3 (student ID, Course number and grade) : 22 COSC175 C

Enter record 4 (student ID, Course number and grade) : 12 ENG317 A

Enter record 5 (student ID, Course number and grade) : 15 ENG317 A

Enter record 6 (student ID, Course number and grade) : 12 PSYC101 A

Enter a student ID for a record search : 12

12 COSC175 A

12 ENG317 A

12 PSYC101 A

Note : If a search had been made for 17, the message "17 doesn't exist in array" would have been displayed.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

100%WORKING....

PROGRAM:::

#include <iostream>

using namespace std;

void printall(int *id,string *course,string *grade,int n)

{

int i=0;

cout<<"\n\t\tRecords" <<endl;

for(i=0;i<n;i++)

{

cout<<id[i]<<" "<<course[i]<<" "<<grade[i]<<endl;

}

}

int main()

{

int studentID[100],i=0,number=0,searchID;

string courseNumber[100],grade[100];

cout<<"Enter the number of records to be input : ";

cin>>number;

for(i=0;i<number;i++)

{

cout<<"Enter record "<<i+1<<" (student ID, Course number and grade) : ";

cin>>studentID[i]>>courseNumber[i]>>grade[i];

}

printall(studentID,courseNumber,grade,number);

while(true)

{

cout<<"Enter the Student ID to Search (0 to quit):: ";

cin>>searchID;

if(searchID==0) break;

cout<<"\n\t\tSearch Result" <<endl;

bool notFound=true;

for(i=0;i<number;i++)

{

if(searchID==studentID[i])

{

cout<<studentID[i]<<" "<<courseNumber[i]<<" "<<grade[i]<<endl;

notFound=false;

}

}

if(notFound)

cout<<"Student with ID "<<searchID<<" not Found"<<endl;

}

}

OUTPUT:::

Add a comment
Know the answer?
Add Answer to:
In C++, write a complete program that receives a series of student records from the keyboard...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Implement a software program in C++ t stores and searches the Student records using double-hashing algorithm.  Double...

    Implement a software program in C++ t stores and searches the Student records using double-hashing algorithm.  Double hashing uses the idea of applying a second hash function to key when a collision occurs.   The software program will be based on the following requirements: Development Environment: If the software program is written in C++, its project must be created using Microsoft Visual Studio 2017. If the software program is written in Java, its project must be created using NetBeans v8.2. Algorithm: If...

  • Kindly solve this using C PROGRAMMING ONLY. 4. Write a program marks.c which consists of a...

    Kindly solve this using C PROGRAMMING ONLY. 4. Write a program marks.c which consists of a main function and three other functions called. readmarks , changemarks (, and writemarks() The program begins by calling the function readmarks () to read the input file marksin. txt which consists of a series of lines containing a student ID number (an integer) and a numeric mark (a float). Once the ID numbers and marks have been read into arrays (by readmarks () the...

  • Looking for some help with this Java program I am totally lost on how to go about this. You have been approached by a local grocery store to write a program that will track the progress of their sale...

    Looking for some help with this Java program I am totally lost on how to go about this. You have been approached by a local grocery store to write a program that will track the progress of their sales people (SalesPerson.java) The information needed are: D Number integer Month 1 Sales Amount-Double Month 2 Sales Amount-Double Month 3 Sales Amount-Double Write a Java program that allows you to store the information of any salesperson up to 20 While the user...

  • Hello. can anyone solve this. i am having hard time with this. please post a solution...

    Hello. can anyone solve this. i am having hard time with this. please post a solution ASAP a) Create a class named Student. Data fields for Student class include an integer Student ID, a String name, and a double CGPA. Methods include a constructor that requires values for all data fields, as well as get and set methods for each of the data fields. b) Create an application that allows a user to enter values for an array of 15...

  • Write a C++ program that defines a structure called StudentInfo for records consisting of a student’s...

    Write a C++ program that defines a structure called StudentInfo for records consisting of a student’s ID, age, final grade for math, final grade for reading, and final grade for music. Define an array of such records to hold up to eight students’ records that the user input students’ information from the keyboard. Then compute and print out the average of their math grades and average of reading, and each student’s average grade of math, reading and music .

  • Write a program that performs the following: 1. Presents the user a menu where they choose...

    Write a program that performs the following: 1. Presents the user a menu where they choose between:              a. Add a new student to the class                           i. Prompts for first name, last name                           ii. If assignments already exist, ask user for new student’s scores to assignments              b. Assign grades for a new assignment                           i. If students already exist, prompt user with student name, ask them for score                           ii. Students created after assignment will need to...

  • Write a C++ program to keep records and perform statistical analysis for a class of 20...

    Write a C++ program to keep records and perform statistical analysis for a class of 20 students. The information of each student contains ID, Name, Sex, quizzes Scores (2 quizzes per semester), mid-term score, final score, and total score. The program will prompt the user to choose the operation of records from a menu as shown below: ==============================================                                            MENU =============================================== 1. Add student records 2. Delete student records 3. Update student records 4. View all student records 5. Calculate...

  • Write a c++ program which uses a structure having the indicated member names to store the...

    Write a c++ program which uses a structure having the indicated member names to store the following data: Name (student name) IDnum (student ID number) Tests (an array of three test scores) Average (average test score) Grade (course grade) The program will keep a list of three test scores for one student. The program may prompt the user for the name, ID number, and test scores, or these may be assigned within the program. The average test score will be...

  • In C++ Write a menu driven C++ program to read a file containing information for a list of Students, process the data, t...

    In C++ Write a menu driven C++ program to read a file containing information for a list of Students, process the data, then present a menu to the user, and at the end print a final report shown below. You may(should) use the structures you developed for the previous assignment to make it easier to complete this assignment, but it is not required. Required Menu Operations are: Read Students’ data from a file to update the list (refer to sample...

  • In C++ 1. Write a program that allows a user to enter 10 integer values from...

    In C++ 1. Write a program that allows a user to enter 10 integer values from the keyboard. The values should be stored in an array. 2. The program should then ask the user for a number to search for in the array: The program should use a binary search to determine if the number exists in a list of values that are stored in an array (from Step #1). If the user enters a number that is in the...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT