The following C++
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.
Learn your wayIncludes step-by-step video
Chapter 2 Solutions
Starting Out with C++: Early Objects
Additional Engineering Textbook Solutions
Introduction To Programming Using Visual Basic (11th Edition)
Programming in C
Database Concepts (8th Edition)
Concepts of Programming Languages (11th Edition)
Java: An Introduction to Problem Solving and Programming (7th Edition)
Software Engineering (10th Edition)
- Deal or No Deal? Code in C languagearrow_forwardVoid Do1 (int: &, a. int &b) { a = 5; a = a + b; b = a + 2; } Int main() { Int x = 10; Do1 (x,x); Cout << x << endl; } The output of this program isarrow_forwardC++ 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.arrow_forward
- 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",…arrow_forwardC++ onlyarrow_forwardC++ - No library functions like atoi Write a machine language program to output your first name on the output device. Submit your "machine code" followed by a 'zz.' An example of the machine code to output "hello" is shown below. This is an example of what a machine language submission would look like: 50 00 48 50 00 65 50 00 6c 50 00 6c 50 00 6f 00 zzarrow_forward
- In C++ Find the five errors. For each error, state the line number, explain the error and show a correction. #include<iostream> #include<iomanip> using namespace std; class colorCode { public: void setRGB(int); //accepts an int parameter and sets the RGB to the value of the parameter void setName(string);//accepts a string parameter and sets the name of the object to the value of the parameter string getName() const;//returns the name of the object int getRGB() const;//returns the RGB of the object void changeColor();// adds 10 to the RGB value private: string name; int RGB; } int main() { colorCode paintCans[10]; int i; for (i = 0; i < 10; i++){ paintCans.setRGB[i] = 0;} paintCans[5].setName(GREEN); paintCan[5].setRGB(192000); cout << paintCans[5].getName << ' ' << paintCans[5].getRGB() << endl; return 0; }arrow_forwardC++arrow_forwardC++arrow_forward
- C++arrow_forwardNeeds to be done in C# language. Problem Write a program that computes and displays the charges for a patient’s hospital stay. First, the program should ask if the patient was admitted as an in-patient or an out-patient. If the patient was an in-patient, the following data should be entered: • The number of days spent in the hospital• The daily rate• Hospital medication charges• Charges for hospital services (lab tests, etc.) The program should ask for the following data if the patient was an out-patient: • Charges for hospital services (lab tests, etc.)• Hospital medication charges The program should use two overloaded functions to calculate the total charges. One of the functions should accept arguments for the in-patient data, while the other function accepts arguments for out-patient information. Both functions should return the total charges. Input Validation: Do not accept negative numbers for any data.arrow_forwardc++, print the outputarrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education