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

?1:?Open a new program calling it?Lab6. Add a new source file calling it: ?Lab6M

ID: 3530017 • Letter: #

Question

?1:?Open a new program calling it?Lab6. Add a new source file calling it: ?Lab6Menu. Paste into it?ProgramBanner. ?2:?Add a menu function PromptUserForSelection() to be called from main() where the user is given the choice to select a loop structure ( the selected loop structure will be later used to calculate the student grade average). ? ?STRUCTURE? SELECTION ?While? W ?DO While? D ?For? F ?Enter Selection : ?The program is to respond to both upper and lower cases. Test the menu with valid selections ?only (for now) ?3:?Add the necessary code to function PromptUserForSelection() that will restrict the user to ?enter a valid selection. If the user's selection is invalid, the function clears the screen and ?re_displays the menu. This is to be repeated until the user enters a valid selection. This also ?prevents the user to quit the program by any selection other than Q. (Hint: use do while loop). ?Test the program with valid and invalid selections. C++ Lab?Page ?4:?Add an if else control structure to main() such that if the selection is not Q ( but by now must be valid), main() will call the function ServiceSelectionUsingIfElse(), to service the selection as will be explained below. If the selection is Q, then main() will terminate the program by displaying the message: ??You Selected to Quit?BYE ?Function ServiceSelectionUsingIfElse() when called will prompt the user for the number of ?grades that will be entered for the student, then it will use nested if else decision structure to decide which control structure was selected to be used to calculate the average and to display the following message indicating to the user the selected structure where is , or , or ??You Selected the Structure 5:?Test your program with various tests inputs to test the bullet proof features in your program. ?Each output should be the display of your banner (with the appropriate entries) and the results of ?the operations performed. ?In the next 4 steps the following five functions will be added to the program and called from within function ServiceSelectionUsingIfElse(): ? ExecuteWhileLoop(),?ExecuteDoWhileLoop( ),?ExecuteForLoop(), ??DetermineLtrGrdUsingSwitch(),?DisplayStudentRecord(). 6:?Add the function ExecuteWhileLoop( ) using WHILE loop structure that prompts the user for the student scores (integers), then computes the Grade Average. ? ?Function ExecuteWhileLoop() is to reject invalid scores (negative scores or scores that are ?greater than 100). Save then use various sets of test data to test your code. An example of program

Explanation / Answer

#include//used for cin and cout 002 #include//because we used some string func. in the code 003 004 using namespace std; 005 006 struct node 007 { 008 char num[100]; 009 char lname[200]; 010 char fname[200]; 011 char gender; 012 char yearlevel[8]; 013 014 node *next;// Pointer to next node 015 }; 016 int ctr=0; 017 node *head = NULL;//head as start pointer 018 019 void add_record() 020 { 021 node *hold,*hold2,*hold3; // Temporary pointers 022 hold=new node; 023 // Reserve space for new node and fill it with data 024 do 025 { 026 027 cout >hold->num; 029 hold2 = head; 030 while(hold2!= NULL) 031 { 032 // hold3 = hold2; 033 if(strcmp(hold->num,hold2->num)==0) 034 { 035 cout num,"" )==0); 049 050 cin.ignore(256, ' '); 051 052 coutgender) 063 {case 'f': 064 cout
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote