In code below k = int i=2.j,k; j = i+1; k = i*j; cout<
Q: Write a Case clause that specifies all numbers less than 0.
A: Select...Case structure: The Select Case is used to specify the multiple alternative choices in a…
Q: A mobile phone service provider has three different subscription packages for its customers: Package…
A: Code: #include <iostream>using namespace std;int main(){ char choice; int mins, extramins;…
Q: When possible, you should avoid using __________ variables in a program.a. localb. globalc.…
A: When possible, you should avoid using ____global______ variables in a program.
Q: Question: Party budget planning - complex Prompt the user to enter their current budget and the…
A: You are ordering food from a restaurant that has two menu items: Tacos $4 Empanadas $3
Q: weight and the name of a planet. Use an enumerated type called planetType to represent the planets…
A: Actually, the code has given below:
Q: Three-letter acronyms are common in the business world. For example, in Java you use the IDE…
A: import java.util.*; public class ThreeLetterAcronym{ public static void main(String []args){…
Q: LIFE INSURANCE PREMIUM CALCULATOR Write a C program that calculates monthly, quarterly, half-yearly…
A: Please find the answer below :
Q: A particular talent competition has 5 judges, each of whom awards a score between 0 and 10 to each…
A: The complete code in python programming language is below:
Q: A BOOKSTORE SELLS BOOKS UNDER THE FOLLOWING CONDITIONS: a. IF THE CLIENT IS TYPE 1, 30% IS…
A: Program: //header file #include <iostream> using namespace std; //main function int main()…
Q: moment that it is declared in C ++ 3. (int Value) its incorrect identifier because
A: Given: Declared variable in C ++ 3. (int Value) its incorrect identifier because........
Q: 1. #include void main() { int number=5; switch (number) { case 1: case 2: case 3: printf("One, Two,…
A: Hello student Greetings Hope you are doing great. Thank You!!!
Q: n C++, using STL algorithms, iterators, or containers get the total from the textfile icecream.txt.…
A: program: #include <iostream>#include <fstream>#include <string>#include…
Q: C1. Write an assignment that assigns to a variable named red_change the percentage change in the red…
A: Required: C1.Write an assignment that assigns to a variable named red_change the percentage change…
Q: A particular talent competition has 5 judges, each of whom awards a score between 0 and 10 to each…
A: Given: To write a program that uses these rules to calculate and display a contestant’s score. A…
Q: Solly’s Sale Stores (S3) have 12 branches in Gauteng. Since his business has been affected by the…
A: The program must contain a function to input data and a function to output data. Add functions to…
Q: With a combined assignment operator, you can re-write the following statement to __. amount =…
A: The correct answer is given below with an example
Q: With the statement, int option=1; switch(option){ int a=1; case 1: printf("1"); while(a<=10){ case…
A: Given code: int option = 1; switch (option) { case1: printf("1"); case2: printf("2"); case3:…
Q: Solly's Sale Stores (S3) have 12 branches in Gauteng. Since his business has been affected by the…
A: Create the text file Data.txt Data.txt Pretoria 0036 108 Centurian 0052 785 Sandton 0024 1045…
Q: A code in c++ or python A program that asks you to enter the name of a movie or series, and then…
A: #using python#asking user to enter movie or series namename = input('Enter name of a…
Q: A) The following program is used in a bookstore to determine how many discount coupons a customer…
A: Task : Considering the above code in C++, the task is required to produce the equivalent output of…
Q: Question: Party budget planning - complex Prompt the user to enter their current budget and the…
A: Calculate and print out all the options of meals where the budget is used entirely(where possible)…
Q: In C# write an application for a furniture company; the program determines the price of a table. Ask…
A: This is simple use of if else if else case. set cost variable as per the condition in if else if
Q: = In code below k int i=2.j.k j = i+1 k = i*j ;cout<<k
A: Here variable i, j and k are integer variable.
Q: Solly’s Sale Stores (S3) have 12 branches in Gauteng. Since his business has been affected by the…
A: Solly’s Sale Stores (S3) have 12 branches in Gauteng. Since his business has been affected by the…
Q: Programing C
A: To solve this problem, First of all you need to create a structure customer with three members, one…
Q: The Meteorological service requires a program to allow the operator to enter the rainfall level. The…
A: use while loop to take values until zero is pressed. store the values into array and then find min…
Q: The language is C# Write a program named TestScoreList that accepts eight int values representing…
A: Program: using System;//using static System.Console; class TestScoreList{static void Main(){int…
Q: a) A prime number is an integer greater than 1 that is evenly divisible by only 1 and itself. For…
A: """PrimeNumber application that prompts the user for a number and thendisplays a message indicating…
Q: What will the following Code segment print on the screen? int P = 30; int Q = 20;…
A: Given data: int P = 30;int Q = 20;System.out.println("Your Total purchase is \n" + (Q*P) +"…
Q: You are required to draw flow chart and write a Pseudocode for the following problem statement.…
A: Pseudo code: 1) Take input all the five values: customer name, mobile model, visit date, total…
Q: valuate the following expression: (3 % 5)
A: need to evaluate the following expression: (3 % 5)
Q: Please comment all of the following code by using multiple line comment symbol. 1/1 int main() {…
A: Commenting the line of code with multiple line comment in c++
Q: int x = 5, y = 2, z = 3; if ( x z) cout 2 ) { cout << z <<" "<< y-x << endl; cout << z * (x + y)<<…
A: The program is written in C++ Language. Please find the source code and output in the below steps
Q: QUESTION 8 Kebabo Internet Services offers customers with 600 weekday minutes for a flat rate of…
A: ANSWER:-
Q: Module/Week 2 ASSIGNMENT (INPUT/OUTPUT) The number of permutations of a set of n items taken r at a…
A: PROGRAM: //include the required header file #include<iostream> using namespace std;…
Q: A Hotel Reservation Program Write a program that allows the user to reserve a room in a hotel and…
A: Source Code: import java.io.*;import java.util.Scanner; public class Reservation{ public static…
Q: Write an application that handles a student report card. The application shall save the marks of…
A: Solution C# PROGRAM using System; //computer science, maths, english //75 congratulationa, else…
Q: getPrice(durianClass, durian Weight) double price=0 durian Class A? F durian Class B? T price=weight…
A: We need to write a C++ program for the given scenario.
Q: Show what the program segment would display on the screen. int x = 2;…
A: Please find the answer below :
Q: Three-letter acronyms are common in the business world. For example, in Java you use the IDE…
A: Approach Built-in methods used: toUpperCase() length() charAt()
Q: Module/Week 2 ASSIGNMENT (INPUT/OUTPUT) The number of permutations of a set of n items taken r at a…
A: //C++ program code: // Required C++ code #include <bits/stdc++.h> using namespace std; long…
Q: Module/Week 2 ASSIGNMENT (INPUT/OUTPUT)The number of permutations of a set of n items taken r at a…
A: C++ Source Code//include the required header file#include<iostream>using namespace…
Q: Enter desired auto service: oil change You entered: Oil change (2) Output the price of the requested…
A: The answer is
Q: Which pair of values for a and b will t #include using namespace std; int main(void) int a,b; b
A: answer=2 a=4,b=1
Q: If you have a String named firstName, type the line of code that defines an integer named…
A: "Since you have not mention any programming language, so we will write our code in C language."…
Q: King room: $100/night| Suite room: $150/night The size of the hotel chains in different locations…
A: FLOWCHART:
Q: A customer want to buy five items. He has only 220.0 OMR with him. The price of the products are…
A: Given: Table is given with item name and price (OMR) as columns. Each item has some price. Goal: We…
Q: Write a program that calculates and displays a person's body mass index (BMI). The BMI is often used…
A: Below is the required C++ program: - Explanation: - Importing the header files and the namespace.…
Q: : Correct the syntax errors void Main () { int x, Y; const a = 14; ww w cin >> x , y; ww if a=x*y;…
A: Things needed to be remember:- c++ is a case sensitive programming language. if you need to use…
Q: bob employs a painting company that wants to use your services to help create an invoice generating…
A: Display "Please enter the working hours in week" Declare a variable workingHours Input the number of…
Step by step
Solved in 2 steps with 1 images
- create a prog that will compute the final grade for a certain student and will display the final grade and a remark if it is passed or failedPass = 75 aboveFailed = 74 belowCS= 60% quiz + 40 assignmentPG =[ 2(Pcs) + PE] / 3TMG = [2(Mcs) +ME] /3MG = [2(TMG) + PG] / 3TFG = Fcs +ME + SFEFG = [2(TFG) + MG ] / 3sample output:enter name of student: Cruzenter quiz Score: 75enter assignment Score: 75enter PE Score: 75PG of Cruz is : 75enter Mquiz Score: 75enter Massignment Score: 75enter ME Score: 75MG of Cruz is: 75enter Fquiz Score: 75enter Fassignment Score: 75enter SFE Score: 75enter FE Score: 75MG of Cruz is: 75FG of Cruz is : 75congrats you PASS/*Author: Cody GuardipeeDate: 5/1/2023Purpose: Calculate Fuel Economy in Miles Per Gallon and Kilometers Per Liter*/ #include <stdio.h> int main(){char destination[100], system;float distance, fuel, mpg, kpl;char units; printf("Enter trip destination: ");scanf("%s",destination); printf("Enter distance traveled(In miles or kilometers): ");scanf("%f",&distance); while (distance <=0){printf("invalid distance. Please enter a valid distance greater than zero");scanf("%f",&distance);} printf("Enter how many units of fuel consumed(In gallons or liters): ");scanf("%f", &fuel); while(fuel <=0){printf("invalid fuel amount. Please enter a valid fuel amount greater than zero ");scanf("%f", &fuel);} printf("Enter system of measument(E for English, M for metric):");scanf(" %c", &units); if(units == 'E'){mpg = distance/fuel;printf("Your fuel economy for the trip to %s was %.2f miles per gallon.\n", destination, mpg);if(mpg > 32){printf("great fuel economy!\n");}…Please write code for this: Canadian Computing Competition: 2022 Stage 1, Junior #2 Fergusonball players are given a star rating based on the number of points that they score and the number of fouls that they commit. Specifically, they are awarded 5 stars for each point scored, and 3 stars are taken away for each foul committed. For every player, the number of points that they score is greater than the number of fouls that they commit. Your job is to determine how many players on a team have a star rating greater than 40. You also need to determine if the team is considered a gold team which means that all the players have a star rating greater than 40. Input Specification The first line of input consists of a positive integer N representing the total number of players on the team. This is followed by a pair of consecutive lines for each player. The first line in a pair is the number of points that the player scored. The second line in a pair is the number of fouls that the player…
- Double any element's value that is less than minValue. Ex: If minValue = 10, then dataPoints = {2, 12, 9, 20} becomes {4, 12, 18, 20}. #include <iostream>using namespace std; int main() {const int NUM_POINTS = 4;int dataPoints[NUM_POINTS];int minValue;int i; cin >> minValue; for (i = 0; i < NUM_POINTS; ++i) {cin >> dataPoints[i];} /* Your solution goes here */ for (i = 0; i < NUM_POINTS; ++i) {cout << dataPoints[i] << " " ;}cout << endl; return 0;} Please help me with this problem using c++.Le Chef Heureux Restaurant has 20 tables that can be reserved at 5 p.m., 7 p.m., or 9 p.m.Design a program that accepts reservations for specific tables at specific times; the user entersthe number of customers, the table number, and the time. Do not allow more than four guests pertable or invalid table numbers or times. If an attempt is made to reserve a table already taken,reprompt the user. Continue to accept reservations until the user enters a sentinel value or allslots are filled. Then display all empty tables in each time slot. Pseudocode and flowchart (RAPTOR please) if possible. Do not write it in any particular language, that is not required.Le Chef Heureux Restaurant has 20 tables that can be reserved at 5 p.m., 7 p.m., or 9 p.m. Design a program that accepts reservations for specific tables at specific times; the user enters the number of customers, the table number, and the time. Do not allow more than four guests per table or invalid table numbers or times. If an attempt is made to reserve a table already taken, reprompt the user. Continue to accept reservations until the user enters a sentinel value or all slots are filled. Then display all empty tables in each time slot. For this homework assignment you need to: create a flowchart using RAPTOR
- Determine whether the given identifier is valid or not. If it is not, change it to make it valid 1)S.W.A.T 2)doubleOf3 3)7Hundred 4)_student_age 5)yenTo$ 6)hoursPerWeek 7)&&timeCheck&& 8)patient--height 9)totalCount 10)speed limitQuestion 18 D The following question uses a robot in a grid of squares. The robot is represented as a triangle, which is initially facing toward the top of the grid. The following code segment moves the robot around the grid. Assume that n is a positive integer.void removeStudent(){System.out.print("\n Enter StudentID to remove: ");long id =sc.nextLong();int pos = searchStudentID(id);if(pos == -1)System.out.println("\n ERROR: No student found having same ID: " + id);elsecourses.remove(pos);} int searchStudentID(long studentID){for(int c = 0; c < students.size(); c++)if(studentID == students.get(c).getId())return c;return -1;} The code is supposed to prompt the user to enter a studentID and if it is in the records then it will be removed, but instead it just prompts me to enter and when i enter the ID, it does not remove the ID (I display the data again after I supposedly removed it but it is still there) and just returns back to the menu. What can I do to correct it?
- void removeStudent(){System.out.print("\n Enter StudentID to remove: ");long id =sc.nextLong();int pos = searchStudentID(id);if(pos == -1)System.out.println("\n ERROR: No student found having same ID: " + id);elsecourses.remove(pos);} int searchStudentID(long studentID){for(int c = 0; c < students.size(); c++)if(studentID == students.get(c).getId())return c;return -1;} The code is supposed to prompt the user to enter a studentID and if it is in the records then it will be removed, but instead it just prompts me to enter and when i enter the ID, it just exits and goes back to the menu. is there something wrong with my code?#include <stdio.h>int main(){int d;int s[20],i, j, p, lg=0,m,t=0;char c;printf("Enter number of sale: ");scanf("%d", &d);for(i=0; i<d; i++){ printf("\n sales %d sales: ",i+1);scanf("%d", &s[i]);}for(i=0; i<d; i++){for(j=i+1; j<d; j++){if(s[i] > s[j]){p= s[i];s[i] = s[j];s[j] = p;}}}printf("\n sales lowest to highest: ");for(i=0; i<d; i++){printf("\nsales %d ", s[i]);}printf("\n highest: %d ",t);getch();} it should be: highest : 2000CHALLENGE ACTIVITY using C++ 1.6.3: Total cost. A drink costs 2 dollars. A taco costs 4 dollars. Given the number of each, compute total cost and assign totalCost with the result. Ex: 4 drinks and 6 tacos yields totalCost of 32. #include <iostream>using namespace std; int main() { int numDrinks; int numTacos; int totalCost; cin >> numDrinks; cin >> numTacos; cin >>totalCost; cout << numDrinks * 2 + numTacos * 4; cout << "Total cost: " << totalCost << endl; return 0;}