Write a program that determines the class of the Ship depending on its class ID (identifier). Here are the criteria. The class ID serves as the input and the Ship class as the output information.
Q: Write / Create a C+ program using only the selection statements such as if, if-else, and switch…
A: First we will input charge, radius and distance from center. Now based on the relation between 'r'…
Q: You are about to enter a place with calculating addition of three numbers. You need to complete the…
A: #include <iostream> using namespace std; class class_1 //declare a class {protected:…
Q: This does not handle the end of month processing correctly. The monthly fee should only be deducted…
A: First, what does a destructor do? It incorporates code that runs every time an item is destroyed.…
Q: Write a program that will take input 3 int numbers as input from user in main and pass all numbers…
A: Note: We are authorized to answer one question at a time, since you have not mentioned which…
Q: Write a C program that plays the game of "guess the number" as follows: Your program chooses the…
A: in order to generate random number in C programming language we are going to use the rand() function…
Q: Identify and correct which statement (s) in the following C++ programs will cause a compiler error?…
A: Question Identify and correct which statement (s) in the following C++ programs will cause a…
Q: Write a program in C++ to calculate and print the Electricity bill of a given customer. The customer…
A: Please find the answer below :
Q: For the program below, assume that a point on a Cartesian plane comprises values representing x and…
A: Declare a class to represent the coordinates of point and we have instance variables to represent…
Q: The annual percentage rate convention for calculating compound interest is as follows: The future…
A: //iostream for input output operations #include <iostream> //cmath for mathematical operaions…
Q: write a C++ program; Use " class cone {}" to output the "radius" and "circumference" of the bottom…
A: Include the iostream library. Create Cone class having instance data members like height, the radius…
Q: Write a statement that calls the function IncreaseItemQty with parameters computerInfo and addStock.…
A: Please find the answer below
Q: Write a C program to take input name, ID and marks of 4 Courses (Physics111, Math120, English102 &…
A: #include <stdio.h>int main(){ char name[20]=""; int ID; printf("Input the name:");…
Q: In C++, create a program that takes in data from the user input and create a "painting" of that…
A: #include <iostream>#include <string>#include <vector>#include <cstring>//…
Q: Understanding Operator Precedence and Associativity Summary In this lab, you complete a partially…
A: The problem demands knowledge of arithmetic operators in c++.
Q: Write a C++ program that takes user inputs and display the monthly record of employees and their…
A: class Employees{ private: int id,salary; string name; static float avg_sal;…
Q: Programing C Create a program that reads a letter grade and outputs a decimal grade. Your program…
A: A C program for the given criteria is as follows, File name: “main.c” #include <stdio.h>…
Q: Programming Language: C++ 1. A constant cannot be passed by reference. = true or false?
A: Explanation: a constant can be passed by reference in c++. Example: void swapNums(int &x, int…
Q: Write a C++ program that calculates and displays the avarage mark in (%) of 3 subjects e,g…
A: Provided below is the C++ program that calculates and displays the average mark in (%) of 3…
Q: write a C++ program. Write a program that calculates and displays the average of a group of test…
A: Solution: Given: • void get score should ask the user for a test score, store it in a…
Q: SOLVE IN "C#" Write c# equivalent statements for the following: A bank is offering Gold and Silver…
A: Procedure Followed: Class Program, Declare variables to store Account information with getter and…
Q: 30 and, Rs. 60 respectively. Design a function that will be called if the customer chooses an…
A: PROGRAM#include<iostream>#include<string>using namespace std;class…
Q: Write a c++ code to print out these requirements, and put a comment and brief description of the…
A: #include <iostream>#include <iomanip>#include <string> using namespace std; int…
Q: Write / Create a C++ program using only the selection statements such as if, if-else, and switch…
A: Step 1 : Start Step 2 : Take user input for the charge Q. Step 3 : Take user input for the Radius…
Q: 1. This submenu is a very handy tool in monitoring how the variables handled its value while they…
A: Solution of given Question from 1-5 are given their
Q: Write a c program that prints: - Your name - Your e-mail address - Your High School - Home town -…
A: Variable definition: A name given to a memory address to store data values is called a variable.…
Q: Write a C++ program to make a class MITStudent and members of this class include char name and int…
A: A C++ program has to be created in which there is a class named MITStudent. In this class, there are…
Q: I am working on a C++ code. What I am trying to do is create a program that asks the user to select…
A: #include <iostream>#include<math.h> using namespace std; int main(){ double t=0.01;…
Q: 1. This submenu is a very handy tool in monitoring how the variables handled its value while they…
A: we need to provide answer for fill in the blanks question
Q: Write 2 functions in C program that calculate surface area and the volume of 3 (three) boxes where…
A: Algorithm: 1. Display the message "Enter sides of the box" 2. Read the all sides 3. calculate…
Q: Write a program in C++ that: Declares a variable suitable for holding a person’s name Prompts the…
A:
Q: Write a program in c++ that asks the user to input two numbers. If the first number entered is…
A: CODE:- #include <iostream>using namespace std;void check(int n1, int n2);int main(){ int…
Q: Create a C program such that executing the item argument with any spaces or newlines will produce to…
A: c programs which is object oriented programming languages that are used to create applications and…
Q: Write a C++ program that requests the user to enter a letter or a digit. Use if-statements and the…
A: The program will take the input character and stores into a variable. It uses IF ELSE condition to…
Q: STRUCTURES, FUNCTIONS, LOOPS, CLASSES, AND OBJECT (OOP)! (You are actually free to choose as long as…
A: Can you help me by creating a C++ program that computes the equivalent resistance of a purely…
Q: rite a C program that shows the function of an atm machine. First ask user to select language, enter…
A: the code is given below : //header file #include <stdio.h> #include <conio.h> #include…
Q: Q1: Choose the correct answer with the explanation reason of your choice. (Answer 1. Which of the…
A: 1. C++ uses int as the default return values for functions. It also restricts that the return type…
Q: write a c++ program as following Create a class named Random Program and add a static function…
A: GIVEN : write a c++ program as following Create a class named Random Program and add a static…
Q: Write c# equivalent statements for the following: A bank is offering Gold and Silver Credit Cards…
A: Programming is instructing a computer to do something for you with the help of a programming…
Q: Write a C program to take input name, ID and marks of 4 Courses (Physics111, Math120, English102 &…
A: We have to write a C program to take input name, ID, and marks of 4 Courses (Physics111, Math120,…
Q: Write C assignment statements for the following: a. Assign a value of 0 to a variable called between…
A: Answer a. /* Here n,k,between are variables*/if(n<-k || n>k) between = 0;else between…
Q: Programming Projects 2.4 Project 2.4.1. Write a C++ program to compute the weekly wage for an…
A: Given The answer is given below.
Q: In C++, write declarations to declare each variable to have the specified type and initial value:…
A: The declarations and initializations of the given variables are done as follows:…
Q: / write a program in C ++ using the syntax (registry), in which the user enters the names, ages and…
A: A program in C ++ using the in which the user enters the names, ages, and numbers of a number of…
Q: Write a program c language to calculate electricity bill charged to a consumer. Ask him to enter…
A: The main objective of the C- program,main.c is to prompt users to enter the number of units…
Q: The programming language is C++, write a program base on the given statement. The national…
A: 1. Input the magnitude of the earthquake 2. If the magnitude < 5, 1. Display the message-…
Q: Write a C # program that will ask 3 values from user an input username in string ,temperarure in…
A: The given problem has a test of Covid is determined using the below criteria Test condition…
Q: Q2: An electricity board charges the following rates to domestic users:- Units consumed Tariff Rs. 5…
A:
Q: Write a C++ Program to find Factorial of a number using class. int main() is provided, all you have…
A: #include <iostream>using namespace std;//factorial classclass factorial{ private: int…
Q: Write a C++ Program in which Write a C++ program for a new ice cream vendor called PopSalon. The…
A: #include <iostream>#include <string>using namespace std;class popcorn{ public:…
Q: write a C++ program. Write a program that calculates and displays the average of a group of test…
A: Given data is shown below: write a C++ program. Write a program that calculates and displays the…
Please create a program C++ base on given statements.
Write a program that determines the class of the Ship depending on
its class ID (identifier). Here are the criteria. The class ID serves as
the input and the Ship class as the output information.
CLASS ID SHIP CLASS
B or b Battleship
C or c Cruiser
D or d Destroyer
F or f Frigate
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images
- Write a program in C++ to calculate and print the Electricity bill of a given customer. The customerid, name and unit consumed by the user should be taken from the user and display the totalamount to pay by the customer. The charges are as follow: The output will display customer id, name, unit consumed and total amount of bill. Now, Write a description/Explanation of this program, that how it's working.In C++, write declarations to declare each variable to have the specified type and initial value: Problem: numberOfDeposits and numberOfChecks to be of type int, each with an initial value of 0; totalDeposits and totalChecks to be of type double, each with an initial value of 0.0; and serviceCharge to be of type double with an initial value of 0.25Using C++, write a whole program to ask the user for his/her name, age, and gpa, then print on the screen "Hello NAME!, you are AGE years old and your Grade Point Average is GPA.", where NAME, AGE, and GPA are replaced by the values that the user typed.User data should be stored in a class variable of type userType, which has three private components: name of type string, age of type int, and gpa of type double.
- An electricity board charges the following rates to domestic users:-Units consumed TariffFor the first 100 units Rs. 5 per unitFor the next 200 units Rs.10 per unitFor the next 300 units Rs.15 per unitWrite a C++ program using class to read the names of users and number of units consumed andprint out the charges (in Rs.) with names. Write in CPP languageWrite 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.For the program below, assume that a point on a Cartesian plane comprises values representing x and y coordinates. The distance between two points in a Cartesian plane can be calculated using the formula derived from d=√((x2-x1)²+(y2-y1)²). Write a C++ program that prompts a user to input two points on the Cartesian plane and works out the distance between them. Use comments in your code, highlight how you have used the following concepts of C++ : class, object, constructors and destructors.
- Write a whole program using c++ to ask the user for his/her name, age, and gpa, then print on the screen "Hello NAME!, you are AGE years old and your Grade Point Average is GPA.", where NAME, AGE, and GPA are replaced by the values that the user typed. User data should be stored in a struct variable of type userType, which has three components: name of type string, age of type int, and gpa of type double.Indicate whether each of the following C# programming language identifiers is legal or illegal. If it is legal, indicate whether it is a conventional identifier for a class. electricBill ElectricBill Electric bill Static void #ssn Ay56we Theater_Tickets 212AreaCode heightInCentimeters Zip23891 VoidWrite a C# program named ProjectedRaises that includes a named constant representing next years anticipated 4 percent raise for each employee in a company. Also declare variables to represent the current salaries for three employees. Assign values to the variables, and display, with explanatory text, next years salary for each employee.
- write a C++ program. Write a program that calculates and displays the average of a group of test scores, allintegers, after the lowest score in the group has been dropped. There are six testscores in the group. The program must contain only the following functions in additionto the main:• void getScore should ask the user for a test score, store it in a referenceparameter variable, and validate it. This function should be called by the mainfunction once for of the six scores to be entered by the user.• double calcAverage should calculate and return the average of the five highestscores. This function should be called just once by the main function, and shouldbe passed the six scores. Use pass by reference to receive the lowest test score.• int findLowest should find and return the lowest of the six scores passed to it. Itmust be called by the calcAverage function, which uses it to determine which ofthe six scores to drop.• void displayResults should be called by the main function to…Write a C++ Program to find Factorial of a number using class. int main() is provided, all you have to do is to create the class. #include <iostream>using namespace std; int main(){ factorial f; f.input(); f.calc(); f.display(); return 0;}Implement 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;}