Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem: You are to create a program that outputs a table of numbers and a set of calculations performed on them. You will first ask

image text in transcribed
image text in transcribed
Problem: You are to create a program that outputs a table of numbers and a set of calculations performed on them. You will first ask the user for a starting point and the number of lines they would like to include in the table. You are to output the following table of values for each n, increasing n by 0.1 each time: n Vn ceiling(n) floor(n) This process will be repeat-ask the user if they would like to continue ('o'N'). In other words, repeat the following until the user enters anything but 'Y: ask the user for the starting point, ask the user for the desired number of lines, perform necessary calculations and output the table For example, here is the output for 8 lines starting at 2.0 for a single set of inputs, i.e., as if the user chose 'N' after the first table is displayed: lease enter a starting value for your table: 2.0 lease enter the number of 1ines for your table: 8 n n2 square-root cube-root ceiling floor 2.0 4.0000 2.1 4.4100 2.2 4.8400 2.3 5.2900 2.4 5.7600 2.5 6.2500 2.6 6.7600 2.7 7.2900 1.4142 1.2599 1.44911.2806 1.48321.3006 1.5166 1.3200 1.5492 1.3389 1.5811 1.3572 1.61251.3751 1.6432 1.3925 2 Requirements: 1. The loop to ask the user for or 'N' inputs will be a do while loop. a. You are welcome to make Y an acceptable input as well, if desired. 2. The table will be generated using a for loop (controlled by the number of lines), You must not control the for loop with a non-integer value. This means everything between the ) in for(.. ) should deal only with integers. Think about how to control the for loop with the number of lines (an integer). a. 3. The starting point entered by the user will be a double, and must be at least 0.0 Perform input validation to ensure that a negative number is not entered. Use a while loop for input validation. If a negative number is entered, ask for a new input for the starting point. a. 4. The number of lines to output in the table will be an integer a. Perform input validation to ensure that a negtive number is not entered. Use a while loop for input validation. If a negative number is entered, ask for a new input for the number of lines. 5. You must use all three types of loops as described above

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2010 Barcelona Spain September 2010 Proceedings Part 1 Lnai 6321

Authors: Jose L. Balcazar ,Francesco Bonchi ,Aristides Gionis ,Michele Sebag

2010th Edition

364215879X, 978-3642158797

Students also viewed these Databases questions

Question

Stages of a Relationship?

Answered: 1 week ago