Question

C++ BEGINNER THIS IS A VERY SIMPLE PROGRAM. WITHOUT ANY LOOPS (HAVE NOT LEARNED LOOPS YET)...

C++ BEGINNER THIS IS A VERY SIMPLE PROGRAM. WITHOUT ANY LOOPS (HAVE NOT LEARNED LOOPS YET) C++ BEGINNER

Write a complete program that read in the distance in Kilometers and output or display the distance in miles 1 KM= 0.62137 mile

0 0
Add a comment Improve this question Transcribed image text
Answer #1
#include <iostream>

using namespace std;

int main() {
    double km, miles;
    cout << "Enter distance in Kilometers: ";   // ask user for distance in kilometers
    cin >> km;  // read number of kilometers from user
    miles = km * 0.62137;   // convert kilometers to miles
    cout << km << " kilometers is " << miles << " miles" << endl;   // display output
    return 0;
}

Add a comment
Know the answer?
Add Answer to:
C++ BEGINNER THIS IS A VERY SIMPLE PROGRAM. WITHOUT ANY LOOPS (HAVE NOT LEARNED LOOPS YET)...
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
  • THIS IS A VERY SIMPLE PROGRAM. WITHOUT ANY LOOPS (HAVE NOT LEARNED LOOPS YET) C++ BEGINNER...

    THIS IS A VERY SIMPLE PROGRAM. WITHOUT ANY LOOPS (HAVE NOT LEARNED LOOPS YET) C++ BEGINNER Write a program that asks for the cost of three items. Then calculate the sum of the costs and a 4% tax. Display the cost of each item, the sum of the items, the tax and the final bill.

  • //Beginner level we haven't done for loops yet but we have done if and if else...

    //Beginner level we haven't done for loops yet but we have done if and if else statements so can you please use that? Write a Java program that reads the ages of three persons from the user, and decides who is the oldest, and who the youngest person is.

  • Write in C. Simple Program (beginner) Assignment: Write a program Character Pointers and Functions. (like program...

    Write in C. Simple Program (beginner) Assignment: Write a program Character Pointers and Functions. (like program #5-5). Keyboard input to enter one character string. Using a single dimension array, populate the array with the character string, call a function using pointers to reverse order the character string, pass back to the main the output and total_count_of_characters. (maybe use a global variable for the total count). Print display the reversed char string and total_count. <END>

  • Project 1, Program Design 1. Write a C program replace.c that asks the user to enter...

    Project 1, Program Design 1. Write a C program replace.c that asks the user to enter a three-digit integer and then replace each digit by the sum of that digit plus 6 modulus 10. If the integer entered is less than 100 or greater than 999, output an error message and abort the program. A sample input/output: Enter a three-digit number: 928 Output: 584 2. Write a C program convert.c that displays menus for converting length and calculates the result....

  • Hello, Is anyone able to do the C++ programming for the below in visual studio. The...

    Hello, Is anyone able to do the C++ programming for the below in visual studio. The code online is giving me errors. It just needs to be very very simple as I am a beginner. I have not learned functions yet but can include the math library. I have only 1 hour. thanks Write a program that reads from the user a positive integer (in a decimal representation), and prints its binary (base 2) representation. Your program should interact with...

  • Write a C++ program to read two matrices with any size. Your program should have at...

    Write a C++ program to read two matrices with any size. Your program should have at least the following functions: Main() Read a matrix Add two matrices Subtract two matrices Multiply two matrices Divide two matrices Display a matrix

  • IN C++ Write a program using for loops to produce the following output. Please read carefully...

    IN C++ Write a program using for loops to produce the following output. Please read carefully the entire specification! Your program must work for any odd number entered by the user, not just 13. (NOTE that there is no space after the colon on the Hill, Triangle, and Diamond labels.) Enter an odd number width: 13 Hill: Triangle no spaces Diamond

  • use  JOptionPane to display output Can someone please help write a program in Java using loops, not...

    use  JOptionPane to display output Can someone please help write a program in Java using loops, not HashMap Test 1 Grades After the class complete the first exam, I saved all of the grades in a text file called test1.txt. Your job is to do some analysis on the grades for me. Input: There will not be any input for this program. This is called a batch program because there will be no user interaction other than to run the program....

  • need this in beginner arduino coding (simple ) ARDUINO 1. Complete the following problem using Arduino...

    need this in beginner arduino coding (simple ) ARDUINO 1. Complete the following problem using Arduino IDE Write a program to detect the temperature of the environment and provide audio and visual cue to user using LED, and Piezo sensor to notify the occupants about a potential fire in the building. In addition, upon fire detection entrance and exit should be opened using a servo motor. (a) Items used & Circuit Schematic (5points) (b) All sensor functionality included based on...

  • HELP NEEDED in C++ (preferred) or any other language Write a simple program where you create...

    HELP NEEDED in C++ (preferred) or any other language Write a simple program where you create an array of single byte characters. Make the array 100 bytes long. In C this would be an array of char. Use pointers and casting to put INTEGER (4 byte) and CHARACTER (1 byte) data into the array and pull it out. Make sure you can access both character and integer data at any location in the array. Read data from a text file....

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