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 - With Access Package
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)
- In C++, Given the following function prototype: void testDefault(int a, int b = 7, char z = '*'); Indicate if each of the following function calls are valid or invalid a) testDefault(5); b) testDefault(); c) testDefault(6, '#'); d) testDefault(0, 0, '?');arrow_forwardEmployees in a company receives net salary after the deductions for tax, Staff Provident Fund (SPF), and Global Insurance (GI): Basic Salary Range ($) Tax Rate SPF GI 0 – 1999 0 % 11 % 1 % 2000 – 2999 5 % 12 % 2 % 3000 – 4999 8 % 13 % 5 % Above 5000 10 % 17 % 8 % Based on the table given, you are required to write a C programming for a system that accepts the employee’s basic salary, and generates the net salary after the respective deductions as described abovearrow_forwardcode for this in C: Instructions: Given the function header, write the appropriate function call with variable declarations. 1. void printHello(void) 2. void depositSavings(float currentS, float addS) 3. void checkAgeBracket(int age, char gender)arrow_forward
- Implement C Programming 7.6.1: LAB: Simple car Given two integers that represent the miles to drive forward and the miles to drive in reverse as user inputs, create a SimpleCar variable that performs the following operations: Drives input number of miles forward Drives input number of miles in reverse Honks the horn Reports car status SimpleCar.h contains the struct definition and related function declarations. SimpleCar.c contains related function definitions. Ex: If the input is: 100 4 the output is: beep beep Car has driven: 96 miles #include <stdio.h> #include "SimpleCar.h" int main() { /* Type your code here. */ return 0;}arrow_forwardWrite a C++ program that calculates the average of a group of test scores, where the lowest score in the group is dropped. It should use the following functions: void getScore() should ask the user for a test score, store it in a reference param- eter variable, and validate it. This function should be called by main once for each of the five scores to be entered. void calcAverage() should calculate and display the average of the four highest scores. This function should be called just once by main and should be passed the five scores. int findLowest() should find and return the lowest of the five scores passed to it. It should be called by calcAverage, which uses the function to determine which of the five scores to drop. **DO NOT USE AN ARRAY OR GLOBAL VARIABLES!!!*** YOU MUST USE THE STATED FUNCTIONS. AND INPUT VALIDATION. For FULL CREDIT DISPLAY THE LOWEST SCORE WITH GOOD OUTPUT DESCRIPTION you MUST USE function prototyping.. DO NOT ACCEPT SCORES LESS THAN 0 OR GREATER THAN…arrow_forwardNote for programmer: 1.Write a separate main() function as a driver for each question. The driver should demonstrate all the required functionalities of a question. 2. Write a c++ code and do not use any String or Math libraries (such as cmath, cstring, string, etc.) and also do not use built-in functions (such as pow, etc.).arrow_forward
- Please do the following and show execution code and output! Write two Haskell functions to calculate ticket prices. Tickets for those ages 12 and under are $8.50, tickets for those between 13 and 65 are $14.50 and those older than 65 are $9.00. The second function should calculate tax – assume tax is 12%. Using function chaining to calculate the total cost. The main function should ask what type of ticket the person wants (child, adult, or senior) and call the functions that you wrote. Show the type signatures of the functions you write.arrow_forwardPROBLEM: Write a C++ program that will allow the user to input the First Name, Last name, Middle Initial, and grade of a student. The following conditions must be observed: If the gradeinput is 96-100, the remarkis “ you performed an excellent job! Keep it up !” If the gradeinput is 91-95, the remarkis “ you performed a very satisfactory Job! Keep it up !” If the gradeinput is 86-90, the remarkis “ you have satisfactory performance, you can improve some more. ” If the gradeinput is 80-85, the remarkis “ your performance is fair, try harder” If the gradeinput is 75-79, the remarkis “ your performance needs Improvement, you can do it” If the gradeinput is below 75, the remark is “ we’re sorry but you failed, we know you can do better next time”arrow_forwardHello good afternoon, Use functional decomposition to write a C++ program that asks the user to enter his or herweight and the name of a planet. Use an enumerated type called planetType to represent theplanets and use a switch statement that takes as its condition a planetType variable. The program,via the switch statement, then outputs how much the user would weigh on that planet. Thefollowing table gives the factor by which the weight must be multiplied for each planet.Your program must have the following functions in it: GetUserInput(),ConvertInputToPlanetType(), and OutputWeight() (your switch statement must be inOutputWeight()). I will let you determine what each function’s parameters and return typesshould be. The program will output an error message if the user does not type a correct planetname. The prompt and the error message will make it clear to the user how a planet name mustbe entered.Use proper formatting and appropriate comments in your code. The output must be…arrow_forward
- Write two Haskell functions to calculate ticket prices. Tickets for those ages 12 and under are $8.50, tickets for those between 13 and 65 are $14.50 and those older than 65 are $9.00. The second function should calculate tax – assume tax is 12%. Using function chaining to calculate the total cost. The main function should ask what type of ticket the person wants (child, adult, or senior) and call the functions that you wrote. Show the type signatures of the functions you write.arrow_forwardWrite a c++ program to display a calendar for a given year. Type of Branches such as switch statements, if-else, and etc. should be used as well. You can't define functions or use Void. Everything should be written inside int main(). Code should be written in this type of format: #include <iostream>using namespace std; int main() { /* Type your code here. */ return 0;} Ask a user to enter the year and the new year's day of the year entered: cout <<"Enter a calendar year to display?"; cout <<" what is the new year's day?"; a leap year is: IF year%4 = 0 AND year%100 != 0 OR year%400 = 0 An example of what the program should display as a result is in the two images attached.arrow_forwardImplement C Programming 7.7.1: LAB: Vending machine Given two integers as user inputs that represent the number of drinks to buy and the number of bottles to restock, create a VendingMachine variable that performs the following operations: Purchases input number of drinks Restocks input number of bottles Reports inventory VendingMachine.h contains the struct definition and related function declarations. VendingMachine.c contains related function definitions. A VendingMachine's initial inventory is 20 drinks. Ex: If the input is: 5 2 the output is: Inventory: 17 bottles #include <stdio.h> #include "VendingMachine.h" int main() { /* Type your code here. */ return 0;}arrow_forward
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr