Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Goals: Practicing nested loops Problem: You are to create a program to output a 2-dimensional table containing the values for d the formula d abc/(a-b)

image text in transcribed
Goals: Practicing nested loops Problem: You are to create a program to output a 2-dimensional table containing the values for d the formula d abc/(a-b) where a has values from2 through 20 in increments of 2, b has values from I to 28 in increments of 3, and the value for e is entered by the user. When a is equal to b, no calculation should be performed. instead three asterisks) should be output. The variables a and b should be whole numbers and the variables c and d should be floating point variables. Calculated values for d should be output to 4 significant digits. Your code should prompt the user to enter the value for c. The use a nested loop structure where the variable a controls the outer loop and the variable b controls the inner loop to determine and output the values for d. Use appropriate formatting concepts to align the columns Below is some sample output Enter a value for c.1.0 The table for d is .000 -4.000-2.800-2.500 -2.364 -2.286 -2.235-2.200-2.174 -2.154 1.333 1.200 12.00-42.00-15.00-11.14-9.600-8.769-8.250-7.895-7.636 1.143 8.00056.00-40.00 -20.80 -16.00 -13.82-12.57 -11-76-11-20 1.11 6.66723.33 1.091 6.000 16.80 60.00 -156.0 -48.00-32.57 -26.40-23.08 -21.00 1.0775.600 14.00 35.00 182.0 -112.0-53.20-38.50 -31.82-28.00 1.067 .333 12.44 26.67 69.33 1.059 5.143 11.45 22.50 46.80 144.0-342. .9.00-6.29-50.40 -9.333-6-667-5-778-5.333-5.067-4.889-4.762-4-66 43.33-26.67-21.1 -18.33 -16-67 -15-56 -101.3-58.67-44-44 -37-33 053 5.000 10.77 20.00 37.14 80.00380.0-220.0-100-0 -70.00 Enter a value fo . 1.25 The table for d is 2.500-5.000-3.5003.125 -2.955 -2.857 -2.794 -2-750 -2.717 -2-692 -11.67-8.333 -7.222-6.667-6.333-.111-5.952-5.833 Lab 5 CMPSC 201-Spring 2019 1.500 15.00 -52.50 -18.75 -13.93-12.00 -10.96 -10.31 9.868-9.545 1.429 10.00 70.00 -50.00 -26.00 -20.00-17.2715.71 -14.7 -14.00 -54.17-33.33-26.39-22.92-20.83 -19-44 1.364 7.500 21.0075.00-1950 -60.00-40-7133.00 -28.85-26.2s 1.3467.00017.50 43.75 227.5 -1400 -66.50-48.13-39.77-35.00 -126.7-73.3355.56 -46.67 1.324 6.42914.32 28.13 58.50 1800-427.5-123.8 -80-36-63.00 1.316 6.250 13.46 25.00 46.43 100. 475.0-275.0 -125.0-87.50 1.389 8.333 29.17 1.333 6.667 15.56 33.33 86-67 Make sure that you have followed the Assignment Guidelines and have not used any concepts beyond Chapter 5 of your textbook, e.g. functions or arrays

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

Advances In Databases And Information Systems 22nd European Conference Adbis 2018 Budapest Hungary September 2 5 2018 Proceedings Lncs 11019

Authors: Andras Benczur ,Bernhard Thalheim ,Tomas Horvath

1st Edition

3319983970, 978-3319983974

More Books

Students also viewed these Databases questions