Starting Out With C++: Early Objects (10th Edition)
Starting Out With C++: Early Objects (10th Edition)
10th Edition
ISBN: 9780135235003
Author: Tony Gaddis, Judy Walters, Godfrey Muganda
Publisher: PEARSON
bartleby

Videos

Textbook Question
Book Icon
Chapter 2.1, Problem 2.1CP

The following C++ program will not compile because the lines have been mixed up.

int main()

}

//A crazy mixed up program

#include <iostream>

return 0;

cout << “In 1492 Columbus sailed the ocean blue.";

{

using namespace std;

When the lines are properly arranged the program should display the following on the screen:

In 1492 Columbus sailed the ocean blue.

Rearrange the lines in the correct order. Test the program by entering it on the computer, compiling it, and running it.

Blurred answer
05:46
Students have asked these similar questions
C++ PROGRAMMING Create a C++ program that accepts an English sentence and converts it to Pig Latin. The rules of Pig Latin are as follows: If the word starts with a vowel, add the word "yay" in the end. If the word starts with a consonant, move the first letter of the word in the end and add "ay" in the end. If the word starts with a capital letter, follow the rule and convert the first letter of the converted Pig Latin word into a capital letter. (i.e. Hello -> ElloHay) If there are numbers in the sentence, they should not be translated. A word with a combination of letters and numbers will not be tested. Spacing and punctations must be preserved. Sample Input: A quick brown fox jumps over the 100 lazy dogs. Expected Output: Ayay uickqay rownbay oxfay umpsjay overyay hetay 100 azylay ogsday.
C++ printSmaller is a function that accepts two int parameters and returns no value. It will print the value of the smaller one parameters. The function protoype is as follows:  void printSmaller(int num1, int num2); write the statments to read two integers and call this function to display the smaller one.
This is the C code I have so far  #include <stdio.h> #include <stdlib.h> struct employees {     char name[20];     int ssn[9];     int yearBorn, salary; };   // function to read the employee data from the user void readEmployee(struct employees *emp) {     printf("Enter name: ");     gets(emp->name);     printf("Enter ssn: ");     for (int i = 0; i < 9; i++)         scanf("%d", &emp->ssn[i]);     printf("Enter birth year: ");     scanf("%d", &emp->yearBorn);     printf("Enter salary: ");     scanf("%d", &emp->salary); }   // function to create a pointer of employee type struct employees *createEmployee() {     // creating the pointer     struct employees *emp = malloc(sizeof(struct employees));     // function to read the data     readEmployee(emp);     // returning the data     return emp; }   // function to print the employee data to console void display(struct employees *e) {     printf("%s", e->name);     printf("  %d%d%d-%d%d-%d%d%d%d",…

Chapter 2 Solutions

Starting Out With C++: Early Objects (10th Edition)

Ch. 2.7 - Prob. 2.11CPCh. 2.7 - Prob. 2.12CPCh. 2.7 - Prob. 2.13CPCh. 2.7 - How would you combine the following variable...Ch. 2.7 - How would you combine the following variable...Ch. 2.8 - Prob. 2.16CPCh. 2.8 - What will the following code display? int number;...Ch. 2.8 - Prob. 2.18CPCh. 2.10 - Prob. 2.19CPCh. 2.10 - Which of the following is a character literal? 'B'...Ch. 2.10 - Prob. 2.21CPCh. 2.10 - What is wrong with the following program...Ch. 2.10 - Prob. 2.23CPCh. 2.10 - Write a program that stores your name, address,...Ch. 2.15 - Is the following assignment statement valid or...Ch. 2.15 - What is wrong with the following program? How...Ch. 2.15 - What will be assigned to x in each of the...Ch. 2.15 - Prob. 2.28CPCh. 2 - Every complete statement ends with a _____.Ch. 2 - To use cout statements you must include the _____...Ch. 2 - Every C++ program must have a function named...Ch. 2 - Prob. 4RQECh. 2 - A group of statements, such as the body of a...Ch. 2 - 'A', and "Hello World" are all examples of _____.Ch. 2 - 978.65 1012 would be written in E notation as...Ch. 2 - Prob. 8RQECh. 2 - Write a C++ statement that defines the double...Ch. 2 - Write a C++ statement that defines the int...Ch. 2 - Write assignment statements that perform the...Ch. 2 - Write assignment statements that perform the...Ch. 2 - Modify the following program segment so it prints...Ch. 2 - Rewrite the follow statement to use the newline...Ch. 2 - Create detailed pseudocode for a program that...Ch. 2 - Prob. 24RQECh. 2 - Prob. 25RQECh. 2 - Create detailed pseudocode for a program that...Ch. 2 - What will the following programs print on the...Ch. 2 - A) #include iostream using namespace std; int main...Ch. 2 - The following program contains many syntax errors....Ch. 2 - Soft Skills Programmers need good communication...Ch. 2 - Sum of Two Numbers Write a program that stores the...Ch. 2 - Sales Prediction The East Coast sales division of...Ch. 2 - Sales Tax Write a program that computes the total...Ch. 2 - Restaurant Bill Write a program that computes the...Ch. 2 - Miles per Gallon A car holds 16 gallons of...Ch. 2 - Distance per Tank of Gas A car with a 20 gallon...Ch. 2 - Number of Acres One acre of land is equivalent to...Ch. 2 - Land Calculation In the United States, land is...Ch. 2 - Prob. 10PCCh. 2 - Triangle Pattern Write a program that displays the...Ch. 2 - Diamond Pattern Write a program that displays the...Ch. 2 - Pay Period Gross Pay A particular employee earns...Ch. 2 - Basketball Player Height The star player of a high...Ch. 2 - Energy Drink Consumption A soft drink company...Ch. 2 - Past Ocean Levels The Earths ocean levels have...Ch. 2 - Future Ocean Levels During the past decade ocean...Ch. 2 - Annual High Temperatures The average July high...Ch. 2 - How Much Paint A particular brand of paint covers...

Additional Engineering Textbook Solutions

Find more solutions based on key concepts
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
Call By Value & Call By Reference in C; Author: Neso Academy;https://www.youtube.com/watch?v=HEiPxjVR8CU;License: Standard YouTube License, CC-BY