Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Thanks in advance. I'm having trouble inputting the following code into my compiler and need help with this assignment. The material is confusing for me.

image text in transcribedimage text in transcribed

Thanks in advance. I'm having trouble inputting the following code into my compiler and need help with this assignment. The material is confusing for me. I had my professor try to explain it but it feels like I'm getting no where and this is due tonight as well. How do I add the shrink input to this specific code and etc? Can someone take a look at my code and show me how to make it run?

Here are the following instructions:

1. Demonstrate you successfully followed the steps in this lab by preparing screen captures of you running the lab as specified in the Instructions above.

2. (x/2) Provide a new function, shrink (float x), that would divide the input value by 2 using the shown code as a template. Support your experimentation with screen captures of executing the new code. Use a new test table with at least 3 distinct test cases listing input and expected output for the new code you created for the shrink function.

3. Why is the number of x's different in the printf statements in the functions?

4. What happens if the user makes a selection other than one of the ones shown in the help prompt (a, b, c, or q in the code shown)? Justify your answer with documented experiments.

5. What would have to be changed in the code if the while statement were changed to: while (menu == 5);

6. Modify the original code and add an additional function of your choice. The function should be unique and something you created for this assignment. Support your experimentation with screen captures of executing the new code. Use a test table with at least 3 distinct test cases listing input and expected output for your unique function.

Thanks again

c https://repl.it/@MomoNicol/MeekTameMeasurements un share elang vezsian 7.0.0-3 umtu.18.04.1 700/Einal Flos include 6double shrink (Int value) void printHelp O 8 prints Cn) 9 prints ("a: a()n): main2c 12 prints(q:uitin 4 vold a(Float ) 17 } // end function a 21 22 end function vold c(float x) { 25x, x, x, v) 27 int eO ioat end Functionc 28 char selection 1 sant s", &selection) f (selection 32 33 q') reture 1 34 35 36 scanf ("%f", &x); f (selection) (selec t lat: (selection a(x) b(x) ; c(x); | | 1+ 1+ 'b') "c') double shrine(int value) 42 Print"shrink of d is in",(int value, Divide) return value/2.0 44 end function 5 Int main) Lab7 (1).pdf 3/6 vold printHelpD printf printr n i"a : aix) -X4xin"); printf g: quitin" vold a(rloat x) end functlon float v print r l" 8(8,2C) ,2r^ 3 *.zt ", v); - " x, x, end functlon b end funetion e char electson; loat printelp o acane ection): 8leetionb') b l 11 end Eunction menu while (nenu )--) printt .bye" l 11 end main c https://repl.it/@MomoNicol/MeekTameMeasurements un share elang vezsian 7.0.0-3 umtu.18.04.1 700/Einal Flos include 6double shrink (Int value) void printHelp O 8 prints Cn) 9 prints ("a: a()n): main2c 12 prints(q:uitin 4 vold a(Float ) 17 } // end function a 21 22 end function vold c(float x) { 25x, x, x, v) 27 int eO ioat end Functionc 28 char selection 1 sant s", &selection) f (selection 32 33 q') reture 1 34 35 36 scanf ("%f", &x); f (selection) (selec t lat: (selection a(x) b(x) ; c(x); | | 1+ 1+ 'b') "c') double shrine(int value) 42 Print"shrink of d is in",(int value, Divide) return value/2.0 44 end function 5 Int main) Lab7 (1).pdf 3/6 vold printHelpD printf printr n i"a : aix) -X4xin"); printf g: quitin" vold a(rloat x) end functlon float v print r l" 8(8,2C) ,2r^ 3 *.zt ", v); - " x, x, end functlon b end funetion e char electson; loat printelp o acane ection): 8leetionb') b l 11 end Eunction menu while (nenu )--) printt .bye" l 11 end main

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

Step: 3

blur-text-image

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

PC Magazine Guide To Client Server Databases

Authors: Joe Salemi

1st Edition

156276070X, 978-1562760700

More Books

Students also viewed these Databases questions

Question

What are limit up- limit down rules?

Answered: 1 week ago

Question

What is the time complexity of this code? (Theta) for (k = 1; k

Answered: 1 week ago

Question

Do you think physicians should have unions? Why or why not?

Answered: 1 week ago