Introduction to Programming with C++
Introduction to Programming with C++
3rd Edition
ISBN: 9780133252811
Author: Y. Daniel Liang
Publisher: Prentice Hall
bartleby

Concept explainers

bartleby

Videos

Textbook Question
Book Icon
Chapter 2, Problem 1CP

Show the output of the following code:

double area = 5,2; cout < < "area"; cout < < area;

Expert Solution & Answer
Check Mark
Program Plan Intro

Give the output of a C++ code.

Program Plan: To give the output for the given lines of code:

double area=5.2;

cout <<"area";

cout<

Program Description Answer

Program Description:

In the given code, a double type variable is assigned the value, 5.2. There are two cout statements. The first cout statement has a string “area� and the second cout statement will

print the value stored in the variable area.

Therefore, the program output will be:

area5.2

Explanation of Solution

Program:

#include // Include the standard input-output stream.

using namespace std;

//Main of the code

int main()

{

//double type variable to store area

double area=5.2;

//cout statement that prints the message “area�

cout <<"area";

//printing the value stored in the variable area

cout<

return 0;

}

Sample Output

Introduction to Programming with C++, Chapter 2, Problem 1CP

Want to see more full solutions like this?

Subscribe now to access step-by-step solutions to millions of textbook problems written by subject matter experts!
Students have asked these similar questions
Write code:
Related to R code. Question: Write a function called temp_categorizer that takes one argument ‘temperature’ and returns the following:         - a value of “hot” if temperature is greater or equal to 90   - a value of "warm" if temperature is greater than 60 but less than 90   - a value of "cold" if temperature is more than 32 but less than 60   - a value of "freezing" if temperature is 32 or below And also Use the following vector for problem number : sentence <- c("Learning", "loops", "in", "R", "is", "not", "that", "bad") Create a loop that: loops over the range of possible word lengths displays a message detailing the words that match the length For example: at length 8, the loop should state that the word "Learning" has 8 letters Hints: Use the function nchar() which gives the number of letters in each word. • Example: try nchar(sentence) min() and max() may help you specify a range
code this:

Chapter 2 Solutions

Introduction to Programming with C++

Ch. 2 - Prob. 11CPCh. 2 - Prob. 12CPCh. 2 - Prob. 13CPCh. 2 - Prob. 14CPCh. 2 - Prob. 15CPCh. 2 - Are the following statements correct? If so, show...Ch. 2 - Write a statement to display the result of 23.5.Ch. 2 - Suppose m and r are integers. Write a C++...Ch. 2 - How would you write the following arithmetic...Ch. 2 - Prob. 20CPCh. 2 - Prob. 21CPCh. 2 - Which of the following statements are true? a....Ch. 2 - Show the printout of the following code: Ch. 2 - Prob. 24CPCh. 2 - Prob. 25CPCh. 2 - Prob. 26CPCh. 2 - Show the following output; Ch. 2 - If you change in line 12 in Listing 2.10, what...Ch. 2 - Show the printout of the following code: Ch. 2 - How would you write the following arithmetic...Ch. 2 - (Convert Celsius to Fahrenheit) Write a program...Ch. 2 - (Compute the volume of a cylinder) Write a program...Ch. 2 - (Convert feet into meters) Write a program that...Ch. 2 - (Convert pounds into kilograms) Write a program...Ch. 2 - (Financial application: calculate tips) Write a...Ch. 2 - (Sum the digits in an integer) Write a program...Ch. 2 - (Find the number of years) Write a program that...Ch. 2 - (Current time) Listing 2.9, ShowCurrentTime.cpp,...Ch. 2 - (Physics: acceleration) Average acceleration is...Ch. 2 - (Science: calculating energy) Write a program that...Ch. 2 - (Population projection) Rewrite Programming...Ch. 2 - (Physics: finding runway length) Given an...Ch. 2 - (Financial application: compound value) Suppose...Ch. 2 - (Health application: BMP) Body Mass Index (BMI) is...Ch. 2 - (Geometry: distance of two points) Write a program...Ch. 2 - (Geometry: area of a hexagon) Write a program that...Ch. 2 - (Science: wind-chill temperature) How cold is it...Ch. 2 - (Print a table) Write a program that displays the...Ch. 2 - (Geometry: area of a triangle) Write a program...Ch. 2 - (Slope of a line) Write a program that prompts the...Ch. 2 - (Cost of driving) Write a program that prompts the...Ch. 2 - (Financial application: calculate interest) If you...Ch. 2 - (Financial application: future investment value)...Ch. 2 - Prob. 24PE
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education
Control Structure in Data Structure - Data Structures - Computer Science Class 12; Author: Ekeeda;https://www.youtube.com/watch?v=9FTw2pXLhv4;License: Standard YouTube License, CC-BY