The Meteorological service requires a program to allow the operator to enter the rainfall level. The program keep accepting the rainfall level until a zero value is entered. The program will keep displaying the current min, max and running average rainfall level after an entry is made. The program terminates by the operator entering a negative value and displaying the total number of entries made.
Q: Write a program that will check the employees years in service and office. • The user will input…
A: For writing the above code, we have used c++ language. Coding in the c++ is easy and efficient. It…
Q: In Python programming language. Write a program that calculates the sum of prime numbers that could…
A: def prime_number(n): #function prime_number if(n == 0 or n == 1): #if n is 0 or…
Q: Ask the user for a name and for a list of test scores. Show the number of tests taken and the…
A: import java.util.ArrayList;import java.util.List;import java.util.Scanner;public class Main {…
Q: Given a set of cities, the central point is the city that has the short- est total distance to all…
A: code: #include <iostream>#include <iomanip>#include <cmath>using namespace std;int…
Q: Write a program that calculates and displays a person’s body mass index (BMI). A person’s BMI is…
A: According to the Question below the Solution: Program Output:
Q: Write a program that allows the user to input his/her name, gender, height (m) and weight (kg). Then…
A: C Program #include<stdio.h>int main(){ char name[50],s[20]; float weight,height,bmi;…
Q: Write program that takes two positive integer arguments and calculates the greatest common divisor…
A: Since no language is specified in the question. I am using c++ language to write the code. See…
Q: Write a simple payroll program that will display employee's information. The program should perform…
A: Given The answer is given below
Q: At a certain university, students have to submit their exams online. The administration decides that…
A: init = int(input("Enter your initial grade: ")) t_loss = int(input("Enter the late submission time…
Q: Program 2 Write a program to ask user to enter number of guests as an integer, and number of hotel…
A: Your python program is given below as you required with an output.
Q: Write a program that asks the user to enter a float number and evaluate the function f(x) as…
A: x=float(input("Enter value of x :")) if(x<=0): f_x=-1*x elif(x<1 and x>0): f_x=x*x else:…
Q: Write a program that asks for the name of a pole vaulter and the dates and vault heights (in meters)…
A: Lets see the solution.
Q: Modify the above program to compute the side area, total area, and volume of a cylinder and the area…
A: GIVEN: Modify the above program to compute the side area, total area, and volume of a cylinder and…
Q: Write a program that asks the user to enter the material they wish to purchase (wood, brick, or…
A: def wood(n): costSingle = 0 shippingCharge = 0 if(n>=1 and n<100): costSingle…
Q: Write a program that reads from the user the registration fees, number of credits required for a…
A: Given: To write a program to calculate the payment to be paid by user each year and satisfying the…
Q: Write a program that prompts the user to enter an integer between1 and 12 and then displays the name…
A: Program approach: Input an integer between 1 and 12. Displays the name of the month that…
Q: Write a program that asks the user to enter the number of courses he/she is taking and then enter…
A: #include <iostream> using namespace std; int main() // main function { int n; //…
Q: Write a main function that performs the following: • Prompts user to enter 2 values A and B. ( • If…
A: Find the required code in C++ as language not mentioned given as below and output :
Q: Write a program that asks the user to enter three values the program then calculates the average of…
A: The following algorithm is needed to develop the program with given description: Include header…
Q: A mail order house sells five different products whose retail prices are as follows: * product 1:…
A: Logic: Use while loop to check the user inputs -1 for productNumber. Repeated accept e product…
Q: a. Write a program that will display the 2 times table on the form as 2X1=2, 2X2=4, 2X3=6 and so on.…
A: Note: As per our guidelines we are supposed to answer only one question. Kindly repost the other…
Q: Write a program that prompts the user to enter a number within the range of 1 through 10. The…
A: Required: Write a program that prompts the user to enter a number within the range of 1 to 10. The…
Q: Write a program that reads from the user the registration fees, number of credits required for a…
A: Given: To write a Java program that reads from the user the registration fees and other requirements…
Q: Write a program that asks the user for a number in the range of 1 through 7. The program should…
A: def main(): # Get the number for the day of the week. day = int(input('Enter a number (1-7)…
Q: Write a program that displays the current year, month, and day using the time(0) function.
A: Answer: Program Plan Define function displayCurrentDate() for displaying the current date in a…
Q: Write a program that prompts the user to enter five test scores and then prints the average test…
A: Note: Below is the required program in C++. Programming Approach: Defining the required header…
Q: PROBLEM: Write a program that prompts the user to input three (3) integers: MM, DD, and YYYY. For…
A: #include <iostream>using namespace std;// to check if year is leap year or notbool isLeap(int…
Q: Write a program that asks for the user’s name and then the program will output the last 4 characters…
A: Note : Since the programming language is not mentioned , I have used C++ language Algorithm : 1 :…
Q: Write a program that determines the real roots of a quadratic equation. To calculate the roots of…
A: Given: given by: D = b ^ 2 - 4ac . If D > 0 the program displays message "The equation has two…
Q: This program should print only the characters from A-Z or a-z. Write a program that prompts the user…
A: Below is the required C++ code. Approach of a Program: Include a necessary header files and then…
Q: Write a program that asks the user to enter the number of students, then enter the grades of these…
A: I have provided C++ CODE along with CODE SCREENSHOT and 2 OUTPUT SCREENSHOTS------------
Q: Write a program that prompts the user to enter five test scores and then prints the average test…
A: - We need to complete the code in C++. - We are dealing with averages.
Q: Write a program that prompts the user to enter the number of courses taken by a student. The program…
A: C++ used to answer this question
Q: In Python Write a program that computes the fuel efficiency for a multi-leg journey. The program…
A: def main(): #Prompt the user to enter the input. start_odo = float(input("Enter the initial…
Q: Write a program that asks the user for a number in the range of 1 through 7. The program should…
A: In c language: #include <stdio.h> int main() { int n; printf("enter any number between 1…
Q: An International Internet phone company has three different subscription packages for its…
A: Given: To write a program that calculates a customer’s monthly bill. It should input the customer…
Q: e to 10 decimal places is 2.7182818285 Write a program that prompts the user for a number of decimal…
A: C++ Code: #include <iostream>#include <iomanip>using namespace std; int main() { //…
Q: Canada has three national holidays which fall on the same dates eac Holiday New year's day Canada…
A: Python used to answer this question
Q: Write a program that asks the user to enter the number of employee's and depending on this number he…
A: Sample Response: //JAVA programimport java.util.*;//Declare a Class Employeeclass Employee{…
Q: Write a program that prompts the user to enter an integer and determines whether it is divisible by…
A: Since there is no programming language, below is the program in python.
Q: In Python programming language. Write a program that calculates the sum of prime numbers that could…
A: Step 1: Read bStep 2: While (temp=true):Step 3: if b is positive Call sum().…
Q: Write a simple payroll program that will display the employee's information, The program should…
A: Question given: Write a Java program that display employee's payroll information. Ask from user…
Q: The user must be able to enter the information for a number of bookings from the keyboard. Ask…
A: Step 1:- Given:- The user must be able to enter the information for a number of bookings from the…
Q: This code read a set of temperatures T(50), determine an average, and then calculate the deviation…
A: Answer is Option-3 i.e., 1-s=s+T(I) 2-Blank 3-A=s/50 4-For I = 1 To 50 5-Blank 6-D(I)=T(I)-A.
Q: Write a program that prompts the user to enter five test scores and then prints the average test…
A: #include<iostream> using namespace std; int main(){ //variables to store each test score,…
Q: Within the program paython... you need to ask for 'input' numbers from 92 to 65 (num 1 (starting…
A: Pyhton is a object oriented programming language which is very easy to use and to implement. It is a…
Q: A sales event at Trader Jane's is reducing some items by 25%. Store that value to a properly named…
A: #include <iostream>using namespace std;int main() { // Write C++ code here int…
Q: Write a program that prompts the user to enter the number of items and each item’s name and price,…
A: Step 1:- Program Approach:- 1.Include the header files 2.Declare variables, an array of data type…
Q: Write a program that asks the user to enter a day (from 1 to 31), a month (from 1 to 12), and a two…
A: here in this question we have asked to write a program which take a day (from 1 to 31), a month…
Hi, need help to
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images
- According to the assignment rule, what should be the precondition in the following program segment?{precondition}x = x − 2{x = y}The Problem: Your program has detected an internal problem that needsdebugging. But the program is not being debugged. How do you let theprogrammer at the problem?Which of the following is necessary for recursion to take place via subprogram calls? stack dynamic local variables type checking returning values from a function static local variables
- /*Exercises: 1. Complete the program below. Sample Run: Hello from main! Hello from the write Message function! Write a custom message: Hello! Hello! Back in main!*/// This program prints a message by calling a function. #include // Required for cin and cout #include // Required for string using namespace std; // Required for not customMessage; // TODO: Call the writeCustomMessage function with the customMessage as a parameter cout << "Back in main!" << endl; return 0; } // The function to write a message void write Message() (cout << "Hello from the write Message function!" << endl; } // The function to write a custom message voidhaving to use std:: // Write a message to the console from a function vold write Message(); void writeCustomMessage(string message); // The main function int main() {cout << "Hello from main!" << endl; // TODO: Call the write Message function string customMessage; cout << "Write a custom message: "; cin >…a) Write a subprogram ISALPHA that checks if a single ASCII character is alphabetic (i.e. between ’A’ and ’Z’ or between ’a’ and ’z’). The char is passed in R0. If the char is alphabetic R0 must be set to 1, to 0 otherwise. b) Write a program that reads a character from the console and prints a message to the console indicating whether the character is alphabetic, using the subprogram from part a.2. A program P calls two subprograms P1 and P2. P1 can fail 50% times and P2 40% times. Then P can fail a. 50% b. 60% c. 10% d. 70%
- Computer Science Write a program that processes a data sequence according to the following specifications: The sequence has three kinds of positive numbers: red, black and white. Each red number is preceded by the letter r, each black number is preceded by the letter b and each white number is preceded by the letter w. The number 0 indicates the end of data. If a number is preceded by any character other than r, b or w, the number is ignored. For instance, if the input to the program is: r 23 b 15 b 11 w 17 c 13 r 19 b 0, then we have two red numbers, 23 and 19, two black numbers 15 and 11, and one white number, 17. The number 13 is ignored. (The terminating 0 is also a black number but it is not processed.) The program produces the following output: The sum of red numbers is 42The sum of black numbers is 26The sum of white numbers is 17 Assume that input is from the keyboard and is in the prescribed format. (a). In 2-3 sentences, describe your strategy for solving this…In C Simulate an Elevator-Controller Program. The Elevator should be able to travel between five floorsnamely Ground, 1st, 2nd, 3rd, 4th and 5th floors. The elevator can travel going up (unless they areat the 5th floor) or going down (unless they are at the ground floor). The elevator can only containone passenger (which is the current user of the program). Initially the elevator begins and loads atthe Ground Floor. If the user wants to travel to the 5thfloor, the elevator shall go up to the saidfloor. It is the option of the user if they want to alight the elevator or not on the 5th floor or anyfloor on the way.Realistic rules should apply: If the user alights at the 4thfloor, when they ride the elevator again, itshould begin traveling from the 4thfloor and from there choose to go up or down. Your programshould have some validation: meaning, only the valid characters should be received by the program(G, 1, 2, 3, 4, 5). If the user keys-in “A” or “-1”, the program should be able to…This program deals with processing the results of a survey which was recently conducted. This survey was intended to determine the percentage of students who walk tocampus, the percentage who drive to campus and the percentage who live in residence on campus.The results of the survey are recorded as follows: WDDL... This data is to be interpreted as follows: the first person surveyed said that he walks – hence W isrecorded, the second person said that he drives – hence D, the third person said that he drives –hence D, and the fourth person said that he lives on campus – hence L. Write a C program to which inputs the response for each student and which computes / outputs therequired percentages. Assume that 25 students were surveyed. Your prompt should have the following format: Do you walk, drive or live on campus. UseW – if you walkD – if you driveL – if you live on campusUse the following data for the execution of your program: W D D L L W D D L L W W D D W L W L L D W L W L D
- This program deals with processing the results of a survey which was recently conducted. This survey was intended to determine the percentage of students who walk tocampus, the percentage who drive to campus and the percentage who live in residence on campus.The results of the survey are recorded as follows: WDDL... This data is to be interpreted as follows: the first person surveyed said that he walks – hence W isrecorded, the second person said that he drives – hence D, the third person said that he drives –hence D, and the fourth person said that he lives on campus – hence L. Write a program to which inputs the response for each student and which computes / outputs therequired percentages. Assume that 25 students were surveyed. Your prompt should have the following format: Do you walk, drive or live on campus. UseW – if you walkD – if you driveL – if you live on campusUse the following data for the execution of your program: W D D L L W D D L L W W D D W L W L L D W L W L DSimulate an Elevator-Controller Program in C programming language. The Elevator should be able to travel between five floors namely Ground, 1st, 2nd, 3rd, 4th and 5th floors. It should have some validation,meaning, only the valid characters should be received by the program(G, 1, 2, 3, 4, 5). If the user keys-in “A” or “-1”, the program should be able to handle such input andnot crash and ask for a correct valid input. The elevator should also travel from B1 to B3 (Basement 1 to 3). The elevator can also allow newpassengers to ride the elevator during the trip of the first user. The number of passengers per tripcan vary.Bank cards are issued to clients of ABC Bank to enter into transactions on their accounts. A new type of card that they issue has a card number which consists of sixteen digits that are unique to each card issued. The card number is compiled in such a way that certain basic information is encoded therein by grouping certain digits. The composition of a card number is as follows: Card number composition 0 3 1 9 2 1 1 1 1 0 0 8 2 3 6 8 T E A Where: T – Type E – Expiry date A – Account number The first four digits (T) represent the card type and issue year in the format TTYY where T is the type (see Table 3.1) and Y is the year, so in the example is 0319 = Diner's club, issued in 2019. The following four digits (E) indicate the card's expiry date in the format YYMM Where Y is the year and M is the Month of the year, so in the example 2111 = 2021, 11th month. The last eight digits (A) indicate the card's account number. The series representing the account number starts with 1 or 0:…