1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
anygoal [31]
4 years ago
6

Write a program that declares constants to represent the number of inches, feet, and yards in a mile. Name the constants INCHES_

IN_MILE, FEET_IN_MILE, and YARDS_IN_MILE respectively. Also declare a variable named miles to represent a number of miles. Compute and display, with explanatory text, the value in inches, feet, and yards—for example: 4.0 miles is 253440.0 inches, or 21120.0 feet, or 7040.0 yards
Computers and Technology
1 answer:
aliina [53]4 years ago
4 0

Answer:

The cpp program for conversion is given below.

#include <iostream>

using namespace std;

 

int main() {

 

// declaring and initializing constant variables with standard values

   const  double INCHES_IN_MILE=63360;

   const  double FEET_IN_MILE=5280;

   const  double YARDS_IN_MILE=1760;

   

   // declaring and initializing miles with a random value

   double miles=4.0;

   

// declaring and computing inches in miles

double inch = INCHES_IN_MILE*miles;

 

// declaring and computing feet in miles

double feet = FEET_IN_MILE*miles;

 

// declaring and computing yards in miles

double yard = YARDS_IN_MILE*miles;

 

// displaying all the calculated values

std::cout<<miles<<" miles is "<<inch<<" inches"<<std::endl;

std::cout<<miles<<" miles is "<<feet<<" feet"<<std::endl;

       std::cout<<miles<<" miles is "<<yard<<" yards"<<std::endl;

   

       return 0;      

}

OUTPUT

4 miles is 253440 inches

4 miles is 21120 feet

4 miles is 7040 yards

Explanation:

The steps in the program are as described.

1. All the three constant variables, mentioned in the question, are declared as double and initialized. These variables hold the fixed conversion values for inches, feet and yards in one mile.

2. The variables are declared constant using the keyword, const.

3. The variable to hold value for mile, miles, is declared as double and initialized with a random value.

4. Next, three more variables are declared as double. These variables will hold the calculated values for inches, feet and yards in the given value of mile.

5. The values are calculated for inches, feet and yards for the given value of variable, miles and stored in the variables mentioned in step 3.

6. These values are displayed to the console along with explanations.

7. The program ends with the return statement.

8. The value of variable, miles, is hard coded in the program and not taken from the user.

9. There is no interaction with the user in this program as this is not mentioned in the question.

10. The program works for all numeric value of the variable, miles, since double accepts integers also.

11. The program can be tested by changing the value of variable, miles.

You might be interested in
What does altgr mean on a keyboard.
Setler [38]
AltGr (also Alt Graph) is a modifier key found on many computer keyboards (rather than a second Alt key found on US keyboards). It is primarily used to type characters that are not widely used in the territory where sold, such as foreign currency symbols, typographic marks and accented letters.
8 0
3 years ago
What is the "key" to a Caesar Cipher that someone needs to know (or discover) to decrypt the message? a) A secret word only know
Tpy6a [65]

Answer:

The number of characters to shift each letter in the alphabet.

Explanation:

Caeser Cipher is the technique of encryption of data, to make it secure by adding characters between alphabets. These are the special characters that make the message secure while transmitting.

According to the standards, For Decryption, we remove these special characters between alphabets to make message understandable.

<em>So, we can say that,to de-crypt the message, the number of characters to shift each letter in the alphabet.</em>

3 0
3 years ago
If you’re storing some personal information like Debit/Credit card numbers or Passwords etc, on different sites for running you’
nata0808 [166]

Answer:

cookies are stored on client side.

A hacker would need access to your computer, either by physically reading the cookie data or by means of cross-site scripting.

Other than that, cookies should not contain passwords or credit card numbers, just things like preferences or session identifiers.

3 0
3 years ago
Sanford is creating an excel spreadsheet and needs to insert many worksheets to organize his data. What is the limit of the numb
Varvara68 [4.7K]

Answer:

The answer is given below in explanation section.

Explanation:

As asked in the question Sanford is creating an excel spreadsheet and needs to insert many workbooks sheets to organize his data, then what is the limit of the number of worksheets excel con contain.

The excel spreadsheet contains as many worksheets as you want but it is limited by the available memory of your computer and system resources. If you have very little memory then you cannot create many worksheets. If you have memory in GBs then you can create thousands of worksheets.

However, it is noted that to create the worksheet is not limited by Excel but it is limited by avilabe memory and system resources. If you have enough computer memory and resources like CPU power etc, then you can create worksheet as many as you want.

It is also noted that the excel worksheet is limited by its number of rows and number of columns it contains e.g. the total number of rows and columns on a worksheet are 1,048,576 rows by 16,384 columns.

If you want to study more about Excel limitation and specifications, the following link may help you

https://support.office.com/en-us/article/excel-specifications-and-limits-1672b34d-7043-467e-8e27-269d656771c3

5 0
3 years ago
Read 2 more answers
Now plz<br>draw the main memory​
Sophie [7]

Answer: Here is my answer- I hope it helps! Btw I did search this up but I change some words so I don't get in trouble again ; - ;

Explanation: A unit of measurement is a definite importance of an amount, defined and adopted by convention or by law, that is used as a standard for measurement of the same kind of amount. Any other amount of that kind can be expressed as a multiple of the unit of measurement. For example, a length is a physical amount.

3 0
3 years ago
Other questions:
  • Is a type of software program used to write code and develop other
    9·1 answer
  • How many types of string types does python support?​
    13·1 answer
  • If you enter 234.567 into a cell that is formatted to display 1 decimal place, what is the value stored in the cell?
    13·1 answer
  • Which command should you select to track changes in a document?
    9·2 answers
  • A program uses two classes: dog and poodle. which class is the base class and which is the derived class?
    7·2 answers
  • What a true portrait reveal
    7·1 answer
  • All the network nodes are connected to each other
    8·1 answer
  • F. Practical Questions
    7·1 answer
  • Pls paanswer asap......​
    10·1 answer
  • use c , c, java or python (any one) programming language for the following programming exercises. do not call built-in library f
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!