Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Draw a flowchart, using Microsoft Visio or LucidChart, to document the logic required to complete this program. Save the flowchart as a PDF file. Develop

Draw a flowchart, using Microsoft Visio or LucidChart, to document the logic required to complete this program. Save the flowchart as a PDF file. Develop a C++ program, following the logic in your flowchart, to generate a table of calculated values. The table must be represented in memory as seven arrays one per column in the output table. Ask the user for three numbers: o The first number represents how many rows are to be in the table (1 to 25). o The second number represents the first value in the first column of the table. (-1000 to +1000) o The third number represents the increment between successive values in the first column of the table. (-10 to 20) Iterate through the values in the first column, generating and saving the following derived values from each value in the iteration. Each calculated value must be saved in the proper row of its designated array. o Square (Write a new function to calculate this value). Type is double. o Square Root (Use the built-in sqrt() function to calculate this value.) Type is double. o Cube (Write a new function to calculate this value.) Type is double. o Cube Root (Use the built-in pow() function to calculate this value). Type is double. o Whether the number is even or odd (Write a new function to determine this value). Type is bool. o Whether the number is prime or not (Use the function developed for HW5). Type is bool. Each user-defined function listed above should have a prototype like double calcCube(int x); for the Square, Square Root, Cube, and Cube root calculations, and like bool isEven(int x); for the Even and Prime evaluations. In all cases, the parameter x is the value in the corresponding row of the first column. Save the results of the calculations in a set of arrays, one array for each of the six calculated/derived values. After all values are calculated and saved, then display the values in a tabular form with one column for each calculated value and a row for each set of values. For each negative value in the first column, display N/A in the columns for square root and cube root. Display Even or Odd for each numbers even/odd status. Display True or False for the numbers prime-ness. Repeat this process, creating and displaying tables, until the user enters a count of zero for the number of rows in the table. Style Document your program according to the style guide presented in class. Bonus Read a series of three-number sets from a data file named triples.txt and create a table of numbers corresponding to each three-number set. Save the resulting tables of numbers to a single text file named numbers.csv in comma-separated-value format.

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

Strategic Database Technology Management For The Year 2000

Authors: Alan Simon

1st Edition

155860264X, 978-1558602649

Students also viewed these Databases questions