The following C++
int main()
}
// A crazy mixed up program
return 0;
#include <iostream>
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.
Trending nowThis is a popular solution!
Learn your wayIncludes step-by-step video
Chapter 2 Solutions
Starting Out with C++ from Control Structures to Objects, Student Value Edition plus MyProgrammingLab with Pearson eText -- Access Card Package (8th Edition)
Additional Engineering Textbook Solutions
Starting Out with Java: From Control Structures through Objects (6th Edition)
Modern Database Management
Java: An Introduction to Problem Solving and Programming (8th Edition)
Starting Out with C++: Early Objects (9th Edition)
Starting Out with Programming Logic and Design (5th Edition) (What's New in Computer Science)
Computer Systems: A Programmer's Perspective (3rd Edition)
- C++ Should use void in the source code. Type the source code with the outputarrow_forwardIn 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_forwardWrite a flowchart and C code for a program that does the following: Within main(), it asks for the user's annual income. Within main(), it calls a function called printIt() and passes the income value to printIt(). You need to include a prototype when creating the function. The printIt() function evaluates the income, and if the number is over 90000, it prints a congratulatory message. If the income is not over 90000, it prints a message of encouragement, like "You WILL make $90,000, if you keep going."arrow_forward
- Implement in 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 main.c #include <stdio.h> #include "SimpleCar.h" int main() { /* Type your code here. */ return 0;} SimpleCar.h #ifndef SIMPLE_CAR_H#define SIMPLE_CAR_H typedef struct SimpleCar_struct { int miles;} SimpleCar; SimpleCar InitCar();SimpleCar Drive(int dist, SimpleCar car);SimpleCar Reverse(int dist, SimpleCar car);int GetOdometer(SimpleCar car);void HonkHorn(SimpleCar car);void Report(SimpleCar car); #endif SimpleCar.c #include…arrow_forward(Electrical eng.) a. The voltage gain of an amplifier is given by this formula: voltagegain=[275 23 2 +0.5 f 2 ]n f is the frequency in Hz. n is the number of stages in the amplifier. Using this formula, write, compile, and run a C++ program to determine the value of the voltage gain for a four-stage amplifier operating at a frequency of 120 Hz. Your program should produce the following display: At a frequency of xxxxx hertz, the voltage gain is yyyyy Your program should replace xxxxx with the frequency and yyyyy with the voltage gain. b. Manually check the value your program produces. After verifying that your program is working correctly, modify it to determine the voltage gain of a 12-stage amplifier operating at a frequency of 9500 Hz.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_forward
- You will get practice in this assignment in the following areas in C/C++:• Writing a simple C++ program• Compiling and linking• Logical expressions• Simple arithmetic and/or assignment statements• Standard Input and output• Variable Declaration• Simple If statements• Simple while statement• Declaring constants and variables• Good programming practices Programming Specifications:1. Your program must produce the minimal bill and coin count.2. Your program must accept values between 1 and 1,000,000 pennies. If a number is entered outside that range your program should continue to ask for a valid number.3. No Global Variables BUT your program must use global constants.4. You must use declared constants in your program and not literal values.5. Only print out non-zero values.. So, if there are no Five’s ….then don’t print zero fives. Design Considerations/Algorithms To see if you need to issue 100 dollar bills you divide the amount of pennies by the number of pennies in a 100 dollar bill.…arrow_forwardPLEASE CODE THIS IN C AND NOT C++. ONLY USE IF/CASE AND USER-DEFINED FUNCTIONS. PLEASE DO NOT USE LOOPS,STRUC, AND POINTERS. PLEASE ONLY DECLARE AND CALL VARIABLES IN THE MAIN FUNCTION, EVERYTHING ELSE IS IN A DIFFERENT USER-DEFINED FUNCTION. PLS CHECK IF IT WORKS TOO.arrow_forwardUsing C++; Define a struct, fruitType, to store the following data about a fruit: Fruit name (string), color (string), fat (int), sugar (int), and carbohydrate (int). Write a program that declares a variable of type fruitType, prompts the user to input data about a fruit, and outputs the fruit data.arrow_forward
- Write a C statement to accomplish each of the following tasks.a) Define variables sum and x to be of type int.arrow_forwardIn C++, please revise/fix the program below according to the instructions and all the criteria. I believe the problem is in int main(). Thank you. Instruction Write and test a function that returns a copy of its string parameter with no repeated characters. The functions ignore case when they compare letters. The functions return strings whose letters are upper case. Write 2 versions of the function: string remDups(const string& original); void remDups(const string& original, string& nodups); Suppose the original string is “Myrtle has big feet” The function returns MYRTLE HASBIGF Test the functions thoroughly. Criteria compile, run, test the test program compiles, runs, and calls both versions of the function without crashingthe test program tests the functions thoroughly function parameters and returns one function has one constant string reference parameter and returns a stringone function has one constant string reference parameter, one string reference parameter and…arrow_forwardPLease make this program work in C++ // This program has three functions: main, beep, and beeper #include <iostream>using namespace std;// Definition of function Beeper. This function displays a message. void Beeper(void) { cout << "I am now inside the function Beeper.\a\a\a\n"; } // Definition of function Beep. This function calls the function Beeper. void Beep(void) { cout << "I am now inside the function Beep.\a"; Beeper(); // Call function Beeper cout << "Now I am back in Beep.\a"; } void main(void) { cout << "I am starting in function main.\n"; Beep(); // Call function Beep cout << "Back in function main again.\n" }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