What header files must be included in the following program? int main() { double amount = 89.7; cout << fixed << showpoint << setprecision(1); cout << setw(8) << amount << end1; return 0; }
Q: def flag(height): t.color("red") a = 165 for i in range(7): t.down () t.begin_fill() t.forward(long)…
A: Problem to convert the given code into R code. Code given:
Q: Programming language: PHP - A simple program that declares a variable name word, that has any word…
A: Sample output Enter word: Hi JohnFinal output: nhoJ iH14
Q: What is true concerning #define ?A.Correctusage is: #define STRING1 STRING2 STRING3 B.This…
A: C/C++ allows including the #define directive in the source program for defining macros. This…
Q: The template code must be incorporated into the following code after the template: // -- brief…
A: A complete code for the given template is as follows, File name: "main.cpp" #include…
Q: Memory is allóčatéd för à fünctión when the funčtión iš declared defined called returned Syntax to…
A: Note: Since the question is multipart we are advised to first three questions. Kindly post other…
Q: C CODE Write a program that takes a given temperature in degrees Kelvin and displays the equivalent…
A: Typecasting is a method of changing an entity from one data type to another.
Q: What will the following program display? #include using namespace std; int main() { int unus, duo,…
A: GIVEN: What will the following program display? #include using namespace std; int main() { int unus,…
Q: #include using namespace std; int main() { int i, j, space; space = 5-1; for(i=1;…
A: A flow chart helps the team to involve and understand the process in its current . This is often…
Q: You have been hired by Detroit Football team as an assistant of the main coach. You need to modify a…
A: PROGRAM: //Header file #include <iostream> #include <string> //Using namespace using…
Q: // Add to this partially built code. // fill in code where there is a TODO…
A: Add data type char for variables destination and typeOfDay. Define bool variable isDayTime and…
Q: //Program 4.6 #include 1 2 3 #include 4 int main (){ char c1, с2, с3, с4; cl=65; c2='A'; c3=0x41;…
A: In this code we get error.
Q: Create a program that has the following requirements: 4.1 menu driven program that…
A: Let us choose the algebra problem that will consist of the addition, a subtraction, a…
Q: Q1)Further enhance your program below as follows (include a loop structure): • allow data to be…
A: Please find code in step 2
Q: // Add to this partially built code. // fill in code where there is a TODO…
A: Add data type char for variables destination and typeOfDay. Define bool variable isDayTime and…
Q: Develop a C# application that inputs one salesperson’s items sold for the last week, then calculates…
A: Hello Student. Warm welcome from my side. Hope you are doing great . I will try my best to answer…
Q: // Airline.cpp - This program determines if an airline passenger is // eligible for a 25% discount.…
A: Note: I HAVE GIVEN THE SOLUTION AS PER THE OUTPUT GIVEN IN THE QUESTION. Define header file…
Q: Function 3: Positive Unique Numbers _missingSpace (string) Create a JavaScript Arrow function that…
A: Answer : Text format of code for the JavaScript file script.js to copy: const _missingSpace =…
Q: Average grades bar chart Write a python program grades.py that reads a file of assignment grades…
A: In this question we have to write a python program to generate average grades bar chart. Let's code
Q: a. A program that accepts data for one auctioned item. Display data for an auction only if the…
A: *As per the company norms and guidelines we are providing first three sub parts of the given…
Q: C++ #main.cpp #include using namespace std; #include "ItemToPurchase.h" int main() { /* Type…
A: Given: C++ #main.cpp #include <iostream>using namespace std; #include "ItemToPurchase.h" int…
Q: 2 #include using namespace std; void func1(int &) ; void func2 (int &, int &) ; void func3 (int,…
A: In func1,func2: Arguments are passed to the function by sending the reference not value. So any…
Q: Write a program that takes a given temperature in degrees Kelvin and displays the equivalent…
A: First you have not declared that in which language you need the code so I'm giving you a code in…
Q: I asked for this to be written in c# instead I got C. Please create a console application of…
A: Given: We need to explain below point in c#. 1. Declare variables with proper data types2. Be able…
Q: 1- Entry Controlled loops: In this type of loops the test condition is tested before entering the…
A: Given few statements The given statements are true or false is discussed below.
Q: Given the following code: long int data[] - {5, 7, 9, 1}; long int ptr - nullptr; Write a statement…
A: 2
Q: What will the following C++ code output in the snippet? #include #include using namespace std; int…
A: Given, Code: #include <iomanip> #include <iostream> using namespace std; int main()…
Q: In Cpp, Write a program that: Defines an enum named Scoops. The enum Scoops will have 3 data…
A: Algorithm: Start Define an enum named Scoops with data values single,Double,tripple Define…
Q: 4.26 Sum of squares Get a number (n) from the user, and then compute the sum of the squares of the…
A:
Q: In CPP , Write a program that: Defines an enum named Classification. The enum Classification will…
A: Here I have created 3 different enums. Next, in the main method, I have taken input from the user…
Q: Q2.1 Assume all necessary header files and namespace have been included. Is there any error in the…
A: - We have to evaluate the code for correction.
Q: Programming Language: C++ I need the codes for extRomanType.cpp, extRomanType.h, main.cpp,…
A: #include <iostream> #include <string> #include "roman.h" using namespace std; void…
Q: QUESTION 10 What is wrong with the following code? #include using namespace std; void displayString…
A: Question 10: There is no parameters passed inside the display string. So the program gives a error.
Q: Declare a data structure marks_t, which contains the following type int members: int attendance…
A: Syntax for declaring a structure is as follows: struct structureName { dataType memberVariable1;…
Q: // EmployeeBonus.cpp - This program calculates an employee's yearly bonus. #include #include…
A: Code: #include <iostream>#include <string>using namespace std;int main() {…
Q: 1- Entry Controlled loops: In this type of loops the test condition is tested before entering the…
A: Given few statements The solution is given below
Q: #include using namespace std; void scanPrice (string [],double []); // Do not modify the code…
A: Textual code :- #include<iostream>using namespace std; void scanPrice(string item[],double…
Q: main.py Load default template. 1 caffeine_mg - float (input ()) 2 x = (caffeine_mg) / 2 3 y =…
A: Here in this question we have given a python code.we have asked to do some modifications so that it…
Q: The template shown below must be incorporated into the code showed after the template Template:…
A: The code incorporated with the template given above is as follows:
Q: // EmployeeBonus2.cpp - This program calculates an employee's yearly bonus. #include #include…
A: Note: Below is the required program in C++. Programming Approach: Declaring necessary header files.…
Q: ample code for the reader-writer: #include #include #include /* This program provides a possible…
A: Include all the necessary libraries. Declare the variables. If reader is first then writer will be…
Q: Find the output of the following program. Assuming all the desired header files are already…
A: #include <iostream> using namespace std; struct Dimensions { int x_cord, y_cord; }; void…
Q: main(){ int a=10; a++; cout<<a++;return 0;} * Linking Error О 11 Compilation Error О 10 What…
A: Firstly a=10 a++ means 10 becomes 11 and in next statement becomes a=12 but it prints 11 because of…
Q: #include #include #include using namespace std; int main() { int monthlyUsage[12]; double…
A: Process Explanation : The above C++ code is used for calculating consumption of electricity in each…
Q: Create a program that has the following requirements: 4.1 menu driven program that…
A: #include <stdio.h> int main() { int sub = Subjects switch (sub) {…
Q: Assign Barbecue's data member numberOfCalories with a value read from input. Then, assign Ham and…
A: 1. input 2 integers a and b 2. assign availablePizzas.at(0).numberOfCalories to a 3. assign…
Q: 3. Complete the function count_digits. This function takes one parameter - a string (s). It should…
A: Note: We are allowed to answer one question at a time, according to the BNED Guidelines. For the…
Q: // Airline.cpp - This program determines if an airline passenger is // eligible for a 25% discount.…
A: Programming instructions: Include necessary header files. Declare all the functions. In the main,…
Q: b) #include 27.0 #includeciostream> using namespace std; void main(){ int x = 2; int y = 5; ? cout…
A: Question 1: part a: code: #include<iostream>using namespace std;int main() {…
Q: 2.24 LAB*: Program: Pizza party weekend Program Specifications. Write a program to calculate the…
A: The float data type is needed to set precision values.
What header files must be included in the following
int main()
{
double amount = 89.7;
cout << fixed << showpoint << setprecision(1);
cout << setw(8) << amount << end1;
return 0;
}
Step by step
Solved in 2 steps
- struct date{ int day; int month; int year; }; Write a function named void increaseDay(struct date *d) that increases the value of a variable of struct date type with integer year, month, and day members by one day. Write a function named void decreaseDay(struct date *d) that decreases the value of a variable of struct date type with integer year, month, and day members by one day. Write a C program that reads from the user a date in d/m/y format and the amount of increase or decrease as an integer. Display the new date in d/m/y format. You may call related functions as many as given increase or decrease value. Note 1: You do not need to consider leap years. Use always 28 days for month February. Note 2: Do not modify the function prototypes. Sample Input1: Sample Output1: 12/8/1990 -5 7/8/1990 Sample Input2: Sample Output2: 26/2/2005 5 3/3/2005 Sample Input3: Sample Output3: 29/12/1998 7 5/1/1999…This need to be written in c++ Write a program that: Defines an enum named Classification. The enum Classification will have 2 data values: undergraduate, graduate. Defines an enum named Status. The enum Stutus will have 2 data values: parttime, fulltime. Defines an enum named Residency. The enum Residency will have 2 data values: resident, international. Defines a student name variable. Creates a Classification, Status, and Residency, credit hour, cost per credit hour, and tuition variable. Reads the value of the Classification, Status, and Residency, student name and credit hour variable from the user. If the student is a fulltime undergraduate resident student, tuition is credit hour times 345.00 If the student is a fulltime undergraduate international student, tuition is credit hour times 685.00 If the student is a fulltime graduate resident student, tuition is credit hour times 545.00 If the student is a fulltime graduate international student , tuition is credit hour times…Function #1: superman Parameters: height - an integer representing the user's height in inches Description: Write a function for the Superman ride at Six Flags that determines whether the user is taller than 4'8" so that he or she can ride a roller coaster. If the user's height, which is provided by the parameter height, is greater than or equal to the minimum height, print the string 'Have a great ride!'. Otherwise, print the string 'Sorry. You must be at least 4 feet 8 inches to ride.' Test Cases: >>>superman(30) Sorry. You must be at least 4 feet 8 inches to ride. >>>superman(70) Have a great ride!
- Lowest Score Drop Write a 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 parameter 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. Input Validation: Do not accept test scores lower than 0 or higher than 100.Question 1: Write a C function that declares a student structure that contains his name, his first name and his student number. Question 2: Write a C function that initializes the cell by taking the 3 parameters from the keyboard. Question 3: Write a function that displays the contents of the cell passed as a parameter.Module/Week 7 ASSIGNMENT (ARRAYS)Use functional decomposition to write a C++ program that asks the user to enter his or her weight and the name of a planet. Use an enumerated type called planetType to represent the planets 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. The following 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 in OutputWeight()). I will let you determine what each function’s parameters and return types should be. The program will output an error message if the user does not type a correct planet name. The prompt and the error message will make it clear to the user how a planet name must be entered. Use proper formatting and appropriate comments in your code. The…
- Module/Week 7 ASSIGNMENT (ARRAYS)Use functional decomposition to write a C++ program that asks the user to enter his or her weight and the name of a planet. Use an enumerated type called planetType to represent the planets 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. The following 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 in OutputWeight()). I will let you determine what each function’s parameters and return types should be. The program will output an error message if the user does not type a correct planet name. 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 utput…Activity 20 Electric Bill: Using Switch Statement, write a program that will calculate and show bills of the Manila Electric Company. The rates vary depending on whether the use is residential (R), commercial( C) , or industrial (I). Any other code should be treated as an error. The program should accept the subscriber ID, Subscriber Name, his total electrical consumption in a month, and the code of the consumer type. The rates are computed as follows: R: 50 plus .50 per kwh used C: 100 for the first 1000 kwh and 0.45 for each additional kwh I: 180 for the first 1000 kwh and 0.75 for each additional kwhYou are developing a Fraction structure for Teacher’s Pet Software. The structure contains three public data fields for whole number, numerator, and denominator. Using the same structure, write the functions described below: • An enterFractionValue()function that declares a local Fraction object and prompts the user to enter values for the Fraction. Do not allow the user to enter a value of 0 for the denominator of any Fraction; continue to prompt the user for a denominator value until a valid one is entered. The function returns a data-filled Fraction object to the calling function. • A reduceFraction()function that accepts a Fraction object and reduces it to proper form, returning the reduced Fraction. For example, a Fraction entering the function as 0 2/6 would be reduced to 0 1/3, and a Fraction entered as 4 18/4 would be reduced to 8 1/2. • A displayFraction()function that displays any Fraction object passed to it. This function displays a fraction with a slash between the…
- The Manhattan distance between two points P(x1,y1) and Q(x2,y2) is defined as follows: M.D. = |x1-x2| + |y1-y2|. Create a structure named Point that models a point in the 2-dimensional space. Using the above structure, take input for two points and calculate the Manhattan distance between them. Use a function named get Distance that will take in 2 Point type variables argument and return the distance in float type.C++ This program does not compile! Spot the error and give the line number. Presume that the header file is error free and // Implementation file for the Rectangle class.1. #include "Rectangle.h" // Needed for the Rectangle class2. #include <iostream> // Needed for cout3. #include <cstdlib> // Needed for the exit function4. using namespace std; //***********************************************************// setWidth sets the value of the member variable width. *//*********************************************************** 5. void Rectangle::setWidth(double w){6. if (w >= 0)7. width = w;8. else{9. cout << "Invalid width\n";10. exit(EXIT_FAILURE);}} //***********************************************************// setLength sets the value of the member variable length. *//*********************************************************** 11. void Rectangle::setLength(double len){12. if (len >= 0)13. length = len;14. else{15. cout << "Invalid length\n";16.…Assignment Description This program will simulate part of the game of Yahtzee! This is a dice game that involves rolling five dice and scoring points based on what show up on those five dice. The players would record their scores on a score card, and then total them up, and the player with the larger total wins the game. A Yahtzee score card has two portions: The upper portion has spaces for six scores, obtained by adding up all of the 1's, 2's, 3's, etc. The lower portion has special scores for various combinations: Three of a kind -- at least 3 dice are the same number;the score is the sum of all five dice Four of a kind -- at least 4 dice are the same number;the score is the sum of all five dice Small straight -- four consecutive numbers are represented, e.g. 2345;the score is 25 points Large straight -- five consecutive numbers are represented, e.g. 23456;the score is 30 points Full House -- three of one kind, two of another; the score is 30 points Yahtzee! -- five of a kind; the…