Start by creating a menu that lists four of the programs you have done for this
ID: 3915493 • Letter: S
Question
Start by creating a menu that lists four of the programs you have done for this course during the past four weeks (Random Sentences)
(Compute Diameter of Circle) and (Escape Sequences) and (calculate Weekly pay.)
. Pick one program from each week 1 thru 4.
Create a function for each of the programs and copy and paste the code into the function. Do NOT copy and paste #include statements or main() just everything below main. Add the code to call the function based on the menu selection.
CAUsers jlabudzikiDesktoplcis126N CIS126L Week5_ project.exe CIS126L Week 5 Project Menu 1. Week 1 Compute Diameter of Circle 2. Week 2 - Calculate Weekly Pay 3. Week 3 4. Week 4 5. Exit Enter an optionExplanation / Answer
#include <stdio.h>
void week1()
{
// put the code for "Compute Diameter of Circle" here
}
void week2()
{
// put the code for "Calculate Weekly Pay" here
}
void week3()
{
// put the code for "Random Sentences" here
}
void week4()
{
// put the code for "Escape Sequences" here
}
int main(void) {
printf("CIS126L Week 5 Project Menu 1. Week 1 - Compute Diameter of Circle 2. Week 2 - Calculate Weekly Pay 3. Week 3 - Random Sentences 4. Week 4 - Escape Sequences 5. Exit Enter an option");
int option;
scanf("%d",&option);
if(option == 1)
week1();
else if(option == 2)
week2();
else if(option == 3)
week3();
else if(option == 4)
week4();
return 0;
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.