Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Objective The objective of this assignment is to practice using loops. You will create several short programming assignments to get more familiar with C +

Objective
The objective of this assignment is to practice using loops. You will create
several short programming assignments to get more familiar with C++ looping
concepts. Please read the full document carefully before starting.
Requirements and Deliverables
This lab has three elements (A - C). Required actions include:
Develop, build and execute the code for each element
Upload your final source code for each lab element to the appropriate
CANVAS upload site. Use the following names for your source files:
Lab Element A --- Calculate and Display a Logarithm Table
Write a program that uses a loop to produce the following logarithm table on
screen. Note that the value x starts at 1, and the step (the difference of x
between two rows) is determined by the value of x; that is the step size, s=
f(x). For example,
when 1x9,s(x)=1
when 10x99,s(x)=10
when 100x999,s(x)=100 and so forth
See table below for further illustration.
When the program starts, it should prompt the user how many rows it will
calculate. Once the user enters this information, the table will be
calculated and displayed on screen.
NOTES:
You do not have to use subscript fonts for the table header. For example,
log10(x) can be displayed as log10(x)
To calculate the step size, s(x), it is recommended that you utilize the
properties of logarithms. For example, for the base 10 logarithm, it
follows that when x=120 :
log10(120)=log10(1.2**102)=log10(1.2)+log10(102)=2+0.07918=2.07918
For x=120, you want s(x)=2. Think about how you can obtain this in
your C++ code. What happens if, say, x=12 or x=1200?
You can use the following C++ functions:
image text in transcribed

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 Spatial Databases 2nd Symposium Ssd 91 Zurich Switzerland August 1991 Proceedings Lncs 525

Authors: Oliver Gunther ,Hans-Jorg Schek

1st Edition

3540544143, 978-3540544142

More Books

Students also viewed these Databases questions