Question
Write program in C++
(25 points) Wr largest number of centimeters in the table are input values. Your table should give conversions in 10-centimeter intervals. One inch equals 2.54 cm. 2. ite a program to display a centimeter-to-inches conversion table. The smallest and Please insert the minimum value to convert to inches >>5 Please insert the maximum value to conver to inches >6e Centimeters Inches 15 25 35 45 1.9685 .99551 9.84252 13.7795 17.7165 21.6535 23.622 60
0 0
Add a comment Improve this question Transcribed image text
Answer #1

#include <iostream>

using namespace std;

int main() {
int minCm;
int maxCm;
int i;
cout<<"please insert the minimum value to convert to inches: ";
cin>>minCm;
cout<<"Please insert the maximum value to convert to inches: ";
cin>>maxCm;
cout<<endl<<"Centimeters \t Inches"<<endl;
cout<<"------------------------------------"<<endl;
for( i=minCm; i<=maxCm; i+=10){
float inch = i/2.54;
cout<<"\t"<<i<<"\t\t\t"<<inch<<endl;
}
if(i!=maxCm){ //for printing the last row if not printed already
float inch = maxCm/2.54;
cout<<"\t"<<maxCm<<"\t\t\t"<<inch<<endl;
}
  
}

Add a comment
Know the answer?
Add Answer to:
Write program in C++ (25 points) Wr largest number of centimeters in the table are input...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • C++ Please Follow Instructions Write a program that displays an inches to centimeters conversion table. Your...

    C++ Please Follow Instructions Write a program that displays an inches to centimeters conversion table. Your input will be the smallest number of inches and the largest number of inches to be converted. The intervals will be in 6 inch increments. One inch is equivalent to 2.54 centimeters. Include the following in your program: 1. Include an initial algorithm that outlines your steps. 2. Include a refined algorithm that details how each step will be executed. 3. Prompt the User...

  • In C please! Thank you! Write a program that finds the smallest (min), largest (max), and...

    In C please! Thank you! Write a program that finds the smallest (min), largest (max), and average (mean) of N values entered by the user. Your program should begin by prompting the user for N, the number of values to be entered. Then the program should accept that number of values, determining the min, max, and mean. Then it should display those values. This is an extension of a previous lab. First, get it working for N values. Then, extend...

  • [C++] Using Files—Total and Average Rainfall Write a program that reads in from a file a...

    [C++] Using Files—Total and Average Rainfall Write a program that reads in from a file a starting month name, an ending month name, and then the monthly rainfall for each month during that period. As it does this, it should sum the rainfall amounts and then report the total rainfall and average rainfall for the period. For example, the output might look like this: During the months of March–June the total rainfall was 7.32 inches and the average monthly rainfall...

  • Use C++ For this week’s lab you will write a program to read a data file...

    Use C++ For this week’s lab you will write a program to read a data file containing numerical values, one per line. The program should compute average of the numbers and also find the smallest and the largest value in the file. You may assume that the data file will have EXACTLY 100 integer values in it. Process all the values out of the data file. Show the average, smallest, largest, and the name of the data file in the...

  • in Java programming Using IF statement, write a program that prints multiplication table for 1-10. Sample...

    in Java programming Using IF statement, write a program that prints multiplication table for 1-10. Sample Program Output. 1     2     3     4     5     6     7     8     9     10       1     1     2     3     4     5     6     7     8     9     10       2     2     4     6     8     10    12    14    16    18    20       3     3     6     9     12    15    18    21    24    27    30       4     4     8     12    16    20    24    28    32    36    40       5     5     10   ...

  • The answer need to write in C programming. QUESTION 2 Write a program using array to...

    The answer need to write in C programming. QUESTION 2 Write a program using array to generate a multiplication table based on the user's input. For example if user enter 5 as input then a multiply table for 1 to 5 is printed as output as shown in Figure Q2. There are three main steps in this program which are: Print rows (a) (b) Print columns Print multiplication of data inside table (c) Select C:\example1 \bin\Debuglexample 1.exe enter the value...

  • Python pleases! Write a program that will produce the following table below. You will use a...

    Python pleases! Write a program that will produce the following table below. You will use a nested for loop and a duplicate nested while loop in one program. Note that this is the one through twelve multiplication table. Write the flowchart for the program. X 1 2 3 4 5 6 7 8 9 10 11 12 1 1 2 3 4 5 6 7 8 9 10 11 12 2 2 4 6 8 10 12 14 16 18...

  • 6-9 please Use the following table to answer questions 6-9: Number of VC MC AVC Earrings FCTC AFC ATC 0 B 2 30...

    6-9 please Use the following table to answer questions 6-9: Number of VC MC AVC Earrings FCTC AFC ATC 0 B 2 30 А 20 D 180 6) What should the value for "A" be? a) 15 b) 20 c) 25 d) 30 e) 35 7) What should the value for "B" be? a) 50 b) 60 c) 70 d) 80 e) None of the above. 8) What should the value for "C" be? a) 36.67 b) 40 c) 43.33...

  • A psychologist is interested in the social interactions of preschool children. She measures the number of...

    A psychologist is interested in the social interactions of preschool children. She measures the number of verbal interactions that each child at a preschool engages in during a day. The frequency distribution of the data is listed in the table below. Class Interval Frequency 6 - 15 1 16 - 25 2 26 - 35 3 36 - 45 3 46 - 55 4 56 - 65 10 66 - 75 7 76 - 85 6 86 - 95 4...

  • 7 Fo row s) assi igned in Table 020) P11-3 (a-f) (p. 618), input the associated disk file to or t...

    please solve for part a data 7 Fo row s) assi igned in Table 020) P11-3 (a-f) (p. 618), input the associated disk file to or tNKAGES, calculate the linkage parameters for crank angles from zero to progra 5 increments with α) = 0, and design a steel disk flywheel to smooth the input 11.7 For the ro a coefficient of fluctuation of 0.05. Minimize the flywheel weight. DESIGN OF MACHINERY Data for Problems 11-5 and 11-7 (See Figure P11-2...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT