Question

Start by creating a menu that lists four of the programs you have done for this course during the past four weeks. 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. Compile and test until you have it working. Use (#include <stdio.h>

ompile and test until you have it working.

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 option

u5_project_pic2.jpg

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

#include <stdio.h>
#include <stdlib.h>

int menu(){
printf("CIS126L Week 5 Project Menu\n");
printf("1. Week 1 - Compute Diameter of Circle\n");
printf("2. Week 2 - Calculate Weekly Pay\n");
printf("3. Week 3 - ");
printf("4. Week 4 - ");
printf("5. Exit\n");
printf("Enter an option ");
int n;
scanf("%d", &n);
return n;
}
void circleData(){
printf("Enter radius of a circle ");
float r;
scanf("%f", &r);
printf("You entered %.2f as the radius\n", r);
printf("Your diameter is %.2f\n", 2 * r);
printf("Your circumference is %.2f\n", 6.28 * r);
printf("Your area is %.2f\n", 3.14 * r * r);
}
int main()
{
int choice = menu();
if(choice == 1){
circleData();
}
return 0;
}

**Comment for any further queries.

Add a comment
Know the answer?
Add Answer to:
Start by creating a menu that lists four of the programs you have done for this...
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
  • This part requires you to write two programs, compile them, and execute them - just like...

    This part requires you to write two programs, compile them, and execute them - just like our lab questions.  You may access these questions as many times as you need to and you have the entire duration of the test to complete these problems. You must submit the program code and the sample outputs for each problem - just like lab. These questions are worth 6 points each. 1.      C++ Write a program that reads 20 data values from a data...

  • This is done in c programming and i have the code for the programs that it wants at the bottom i ...

    This is done in c programming and i have the code for the programs that it wants at the bottom i jut dont know how to call the functions Program 2:Tip,Tax,Total int main(void) {    // Constant and Variable Declarations    double costTotal= 0;    double taxTotal = 0;    double totalBill = 0;    double tipPercent = 0;    // *** Your program goes here ***    printf("Enter amount of the bill: $");    scanf("%lf", &costTotal);    printf("\n");    // *** processing ***    taxTotal = 0.07 * costTotal;    totalBill...

  • part 1(do not write on note book and before send program compile it) void testStruct01() this...

    part 1(do not write on note book and before send program compile it) void testStruct01() this function is called from main in main() call the function void test01() in the function void test01() 1. create a FootballTeam object    2. using 'cin', load the FootballTeam object   3. using 'cout', display (print) the FootballTeam object 4. output should look like the following         ********** AFC East ********** Home Team              XXXXXXXXXXXXXXXXXXXXXXXX Opponent team          XXXXXXXXXXXXXXXXXXXXXXXX Home Team score        XXXXXXXXXXXXXXXXXXXXXXXX Opponent team score   XXXXXXXXXXXXXXXXXXXXXXXX part...

  • You will be writing some methods that will give you some practice working with Lists. Create...

    You will be writing some methods that will give you some practice working with Lists. Create a new project and create a class named List Practice in the project. Then paste in the following code: A program that prompts the user for the file names of two different lists, reads Strings from two files into Lists, and prints the contents of those lists to the console. * @author YOUR NAME HERE • @version DATE HERE import java.util.ArrayList; import java.util.List; import...

  • 1. Make a function make_list_of_lists(n, m) that creates and returns a list of n lists of...

    1. Make a function make_list_of_lists(n, m) that creates and returns a list of n lists of size m, where each of the m elements in a sublist are randomly generated integers between 1 and 9. For example, you might obtain l = make_list_of_lists(2,2) >>> print(l) [[1, 4], [5, 7]] Big Hint: You can do this using numpy along the lines of the following code: import numpy >>> l = list(numpy.random.randint(a,b,c)) where you need to sort out what the values of...

  • Simple python assignment Write a menu-driven program for Food Court. (You need to use functions!) Display...

    Simple python assignment Write a menu-driven program for Food Court. (You need to use functions!) Display the food menu to a user (Just show the 5 options' names and prices - No need to show the Combos or the details!) Ask the user what he/she wants and how many of it. (Check the user inputs) AND Use strip() function to strip your inputs. Keep asking the user until he/she chooses the end order option. (You can pass quantity1, quantity2, quantity3,...

  • Perform all of the following steps using Notepad to complete this assignment: 1) Begin by creating...

    Perform all of the following steps using Notepad to complete this assignment: 1) Begin by creating a new file in your text editor and include all of the basic HTML code like you did in your previous assignments. Or you can simply make a copy of your HTML file from last week and name the new copy LastFirstAssignment7.html (where “Last” is your last name and “First” is your first name), but be careful not to overwrite your file from last...

  • Please help me to do my assignment it should be python. Thank you Write a menu-driven...

    Please help me to do my assignment it should be python. Thank you Write a menu-driven program for Food Court. (You need to use functions!) Display the food menu to a user (Just show the 5 options' names and prices - No need to show the Combos or the details!) Ask the user what he/she wants and how many of it. (Check the user inputs) AND Use strip() function to strip your inputs. Keep asking the user until he/she chooses...

  • Creating the Home and Template Pages Overview In this assignment, you will start building your Web...

    Creating the Home and Template Pages Overview In this assignment, you will start building your Web site for your fictional organization by creating a homepage using HTML5 and some of the key elements that define a Web page. You are required to use either a simple text editor to write your code, or an enhanced text editor such as Brackets. Note: Microsoft Word is not a good tool for developing code because it is a document processor and not a...

  • Instructions Now, you introducing a "for" loop. This loop runs a pre-determined number of times. The...

    Instructions Now, you introducing a "for" loop. This loop runs a pre-determined number of times. The "for" loop initiates the counter variable, determines how many times the loop will run and generally increments or decrements the counter variable. In this example, the counter is initialized to 1, and it increments by one each time the loop runs. The loop rings the value of the counter variable each time it runs. Here's the Flowchart: Main Integer counter Next counter 1 to...

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