integers and unit cost

Write a program that prompts the user to enter the area of the carpet in square meters and the unit price per square meter. The values are to be read into an integer area and a float unitCost respectively. Define the variables and use only one statement to read them. Afterwards, print each value with the name of the variable on a separate line

And what's your question?
I don't understand how to do it
closed account (3qX21hU5)
1
2
3
4
5
6
7
8
9
10
int main()
{

    // Declare the variables you need here. Hint: A float and integer.

    // Ask for user input here. Hint: std::cin

    // Put your output statement here 
    // Hint: Remember to output to the console you use std::cout
}
Last edited on
@zereo Can you give me a little more info, I'm struggling heavily.
closed account (jwkNwA7f)
Zereo explained it petty well. We can't do your homework for you.
@retsgorf297 Hey man thanks for your input! It's actually not homework, I'm trying to teach it to myself and it's a problem I found online
closed account (jwkNwA7f)
Like Zereo said, in your main function you will need to declare the variables you are going to use first. You will need a float and an integer (int).
Next, you will need to get the user's input and assign it to the variables. You can do that using std::cin .
Then you need to output the statement. To output to the console, you can use std::cout .
Last edited on
Topic archived. No new replies allowed.