Question 1 Write a program that finds the new salary of an employee after several years of work experience. Your program should ask the user to enter the name of the employee, the old salary and number of working years; then it should calculate and output the new salary using this equation: Old salary + years * 75 New salary 0.8 Sample run: Enter employee's name, old salary and years: John 900 5 Name New Salary John 1593.75
Q: Given an airplane’s acceleration a and take-offspeed v, you can compute the minimum runway length…
A: Program code: //Importing utility for inputimport java.util.Scanner;//define a class…
Q: compare loans with various interest rates) Write a programthat lets the user enter the loan amount…
A: By given problem, it is to be desired to display the user different loan amounts according to the…
Q: Write a program for a pharmacy to generate bills. The program should ask about the code associated…
A: The program is written in C++ #include <iomanip> #include <iostream> using namespace…
Q: Write a program that tells what coins to give out for any amount of change from 1 cent to 99 cents.…
A: Program: //Include necessary header files #include <iostream> using namespace std;…
Q: 3. Write a program that plays a guessing game with the user. The program should generate a random…
A: According to the information given:- We have to follow the instruction in order to create guess game…
Q: Q1: Write a program that reads a set of N integers. Then, the program finds and outputs the sum of…
A: Below I have provided a python program for the given question. Also, I have attached a screenshot of…
Q: Problem #3: Write a program that reads the width, height and a character from the user, then…
A: As there is no programming language is mentioned we are writing this program in c++ Code…
Q: Average acceleration is defined as the change of velocitydivided by the time taken to make the…
A: Program code: //include the header files #include <iostream> using namespace std; //define…
Q: Q1: Write a program that reads 10 numbers and then finds the largest number and prints it and finds…
A: - The question wants us to find the largest and smallest number after reading 10 numbers and print…
Q: Given an airplane’s acceleration a and take-off speed v, you can compute the minimum runway length…
A: #include <iostream>using namespace std; int main(){ float velocity, acceleration;…
Q: Write a program that reads from a student his/her name and his/her ID which is formed of 8 digits.…
A: The solution to the given problem is below. **Note: As programing language is not mentioned in the…
Q: Write a program that reads any 5 numbers as in the given sample of output below: Sample of…
A: Required: Write a program that reads any 5 numbers as in the given sample of output below:
Q: A quadratic equation is an equation of the form ?? 2 + ?? + ? = 0 where ?, ?, and ? are the…
A: Step 1:- Note:-There is no output format is given therefor I solve the quadratic equation and find…
Q: Homework01. Write a Java program that prompts the user to enter the seconds as a String (e.g.,…
A: - The question is to complete the conversion.
Q: Display basic salary, bonus and net salary
A: EXPLANATION--> Firstly input two variable named with salary and grade If grade is greater then…
Q: Write a program that keeps prompting the user to enter the first character of his favorite car; and…
A: The user enters the first alphabet of the car and his/her car’s name get displayed.
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: C++ In this task, you are required to write a code that converts an Octal number into its…
A: Choice 1 is followed by inserting an Octal integer and getting its Decimal equivalent value as an…
Q: Given the sample code above in generating a random number. Create a program that lets the user play…
A: Code: #include <iostream> using namespace std; int main(){ //declare variableint userChoice,…
Q: Consider records of employees each consists of employee's first name (string), number of hours…
A: I give the code in python along with output and code screenshot
Q: Write a program that prompts the user to input three numbers. The program should then output the…
A: The given is the requirement to solve the problem in C++ programming lanague where: a) User will…
Q: C++ Write a program that takes in a line of text as input, and outputs that line of text in…
A: Program approach: Including header files Starting the main function Initializing string variables,…
Q: Part 3: Write a sales tax calculator for a world without pennies or nickels For this program, you…
A: C++ program to solve and given a problem to build the tax calculator and printing the output.
Q: Write a program that reads in loan amount, annual interest rate and number of years for the loan and…
A: Actually, program is an executable software that runs on a computer.
Q: Question 1 Write a program that asks the user to enter the number of passengers in an airplane and…
A: "Since you have not mention any programming language, so will write our program in C language." C…
Q: 9) Write a program that takes in the user's name and age. Then displays his/her name's initial…
A: #include<iostream> using namespace std; int main() // main function { string name,…
Q: Q4 write a program that accepts a day, month and year then calculate the day of year corresponding…
A: Given requirement, Write a program that accepts a day, month and year then calculate the day of the…
Q: 1. A software company sells a package that retails for $99. Quantity discounts are given according…
A: logic:- take quantity as user input. apply if else to find out discount. at last subtract…
Q: Write a program that calculates the total grade for N classroom exercises as a percentage. The user…
A: C++ is just an object oriented programming language not only based on objects but also based on…
Q: Write a program that asks the user to enter an amount of money in the format of dollars and…
A: Program converts the amount taken from user in dollars and cent and returns the amount of coins user…
Q: Write a program that reads from the user the product unit price, tax percentage to be applied on the…
A: Given: write the program using java
Q: 9. Write a program that computes the fuel efficiency of a multi-leg journey. The program will first…
A: First prompt for the starting odometer reading and then get information about a series of legs.…
Q: Write the reading program: basic salary (bsalary) and sales (sales), then calculate and print the…
A: Here, first you need to declare some variables for all salaries. Then prompt user to enter basic…
Q: Write a program that prompts the user to enter the name, the number of children, an i the basic…
A: According to the asked question, the solution is given below with a proper explanation.
Q: 1. Write a program that will read an employee name (use your Name as input in employee name),…
A: Solution - Programming Language - C All necessary comments are included in program code. Program…
Q: Q5/ 1. 1. Write a program to read three marks and calculate the average. If the student's average is…
A: Since no programming language is mentioned, I am using python. As per our guidelines, we are…
Q: Write a program that calculates the amount of money a person would earn over a period of time I f…
A: According to the information given:- We have to follow the instruction in order to get the desired…
Q: Part 1: Write a complete program that allows the user to enter the last names of 5 candidates in…
A: Given:
Q: Create a program that takes in a student’s full names and marks for 3 In-class exercises, then…
A: Since the programming language is not mentioned in the question. So, we have solved this question…
Q: Write the reading program: basic salary (bsalary) and sales (sales), then calculate and print the…
A: C++ program is given below
Q: Given the sample code above in generating a random number. Create a program that lets the user play…
A: According to the information given:- We have to create rock paper and scissor game on the basic of…
Q: 1. Federal law requires that hourly employees be paid "time-and-a-half" for work in excess of 40…
A: #ask user for hourly wage hourly_wage = float(input('\nEnter hourly wage: ')) #ask user for Number…
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: Given the sample code below in generating a random number. Create a program that lets the user play…
A: #include <iostream> #include <string> //to work with strings #include <cstdlib>…
Q: We want to compute a taxi travel price. Write a program that asks the user to enter: The travel…
A: Given: To write java program according to the given conditions for calculating the taxi travel…
Q: 7) Write a program that asks the user the number of hours an employee worked and his hourly wage,…
A: code:-- #include <iostream>using namespace std; int main(){ // to store the total_hour and…
Q: Write a program that prompts the user to enter the name, the number of children, and the basic…
A: Please give positive ratings for my effort. Thanks. PROGRAM #include<bits/stdc++.h>using…
Q: a) Write a program that defines variables a, b, c, d as float and Num2 as integer. Solve the…
A: The program is a simple arithmetic operation using variables and different data types. Variables…
Q: 6) Write a program that prompts the user to input a number. The program should then output the…
A: According to the asked question, the solution is given below with a proper explanation.
Control structures
Control structures are block of statements that analyze the value of variables and determine the flow of execution based on those values. When a program is running, the CPU executes the code line by line. After sometime, the program reaches the point where it has to make a decision on whether it has to go to another part of the code or repeat execution of certain part of the code. These results affect the flow of the program's code and these are called control structures.
Switch Statement
The switch statement is a key feature that is used by the programmers a lot in the world of programming and coding, as well as in information technology in general. The switch statement is a selection control mechanism that allows the variable value to change the order of the individual statements in the software execution via search.
Step by step
Solved in 3 steps with 1 images
- CSCI250L Sample Exam 1 Spring 2020-2021 Question1 (50 pts) Write a program that prompts the user to enter the name, the number of children, and the basic salary of an employee. The program will then: Calculate the bonus: bonus = number of children * $25 Calculate the new salary: new salary Apply a tax of 10% and find the paid salary: paid salary = new salary * (1 – tax) %3D salary + bonus The program will then display all the information needed as shown in the sample run below Sample Run: Enter the name of the employee: Jamal Enter the number of children of the employee: 4 Enter the salary of the employee (in $): 1500 The calculated bonus is $100 for 4 children. The new salary is $1600.0 The paid salary for Jamal is $1440.0Assignment Write a program that tracks how much steps the user walks in total in a day and reports if the daily target is reached or not. The program will keep reading double values, each representing steps walked during an individual activity within a day (stepsWalked) until either the user enters a negative value or the daily target of 5000 steps is met. If the user enters a negative number, the program should print total steps walked as a double. Otherwise, if the target is exactly reached, the program should simply print "Target is reached", finally if the target is surpassed the program should print the text "Target is surpassed by", followed by the excess amount above the target as a double, and finally printing the text "steps". NOTE: You MUST use a repetitive statement in this question. NOTE: Each stepsWalked value will be given as a non-negative value. You do NOT need to check this. Input Output Answer assignment 3000 1300 500 2305.2 Target is surpassed by 2105.2 steps 450…17. Math Tutor Write a program that can be used as a math tutor for a young student. The program should display two random numbers to be added, such as 247 +129 The program should then pause while the student works on the problem. When the student is ready to check the answer, he or she can press a key and the program will display the correct solution: 247 +129 376
- Python Assignment: In India McDonald's has the n number of customers and they are famous for their taste and quality so they plan to Organise the challenge for foody people. What is the challenge is?| you have taken a food challenge from the Chef and now you have to eat directly the Y burgers. You will eat as follows: At the first minute you will eat exactly the X burgers and every minute after that you will eat twice the number of burgers you ate the minute before. As you can get tired of food, Chef also lets you take a break from eating for one minute. When you start eating again after a break, your food streaks are reset, which means that in the first minute after the break you will eat X burgers and every minute after that you will eat the burgers you ate twice the last minute. Allow a1, a2, ., let it be your meal length in minutes. The cook needs to have all the ai different in pairs. Get the minimum number of minutes you need to eat Y burgers directly or decide that it is not…Problem: A small company needs an interactive program to compute an employee’s paycheck. The payroll clerk will initially input the data, and given the input data, an employee's wage for the week should be displayed on the screen for the payroll check. The data for the employee includes the employee's hourly pay rate and the number of hours worked that week. Wage is equal to the employee's pay rate times the number of hours worked (up to 40 hours). If the employee worked more than 40 hours, wage is equal to the employee's pay rate times 40 hours plus 1½ times the employee's pay rate times the number of hours worked above 40. Instructions: Match the action at the left-side with the correct step number at the right-side (the attached picture). Note that it may be possible to group more than one related actions in the same logical step / process without altering the essence of the algorithm. In the program flow, input and checking of hourly pay rate should come before that of the number…CSCI250L Sample Exam 1 Spring 2020-2021 Write a program that prompts the user to enter the name, the number of children, and the basic salary of an cmployee. The program will then: Calculate the bonus: Calculate the new salary: • Apply a tax of 10% and find the paid salary: The program will then display all the information neceded as shown in the sample run below Sample Run: Enter the name of the employee: Jamal Enter the number of children of the employee: 4 Enter the salary of the employee (in $): 1500 The calculated bonus is $100 for 4 children. The new salary is $1600.0 The paid salary for Jamal is $1440.0 Page 2 1 3
- Q1/ Write a program that reads from the user the number of students in the class and their grades in one class, the program must find the largest and the lowest grades with the sequence of students and then find the average grade of the class, see the example below: N is the numbers of students in one class X is the grade for each student in the class For example Student # 1 = 89 Student # 2= 60 Student # =80 You must find the largest and the lowest grades with the sequence of the student. The largest grade is 89 the student's number is 1 The lowest grade is 60 the student's number is 2 The average grade of the class is 76.333SOLVE IN C# Canada Government has announced 250 immigration visa lottery for third world countries. Total number of Application collected 10000, starting from application number 1 to 10000. You are required to write a program for Canadian government to select 250 visa for lottery visa, randomly from the pool of 10000 application and print the application number on screen Note: No input required in this programDomino's Time Function Name: dominosTime() Parameters: N/A Returns: None Description: During the summer, you ordered a lot of food from Domino's. Pizzas are $12, an order of pasta is $6, and chicken wings are $8. Write a function that asks the user how many of each food item they would like, and then print a response telling them what their order to- tal will be. The order total should be an integer. >>> dominosTime() How many pizzas do you want? 3 How many orders of pasta do you want? 2 How many orders of chicken wings do you want? 2 By ordering 3 pizzas, 2 orders of pasta, and 2 orders of chicken wings, your order total comes to $64.
- Problem 1 - Methods Write a program that has a loop of three iterations. In every iteration, the program should prompt the user to enter three integers then invoke a method called hasOddEven that takes the three integers as parameters and returns true if there is at least one odd and at least one even among the three numbers and that returns false otherwise. Below are some sample calls and the returned value: Method Call Value Returned hasOddEven(2, 4, 6) False hasOddEven(2, 3, 4) True hasOddEven(12, 4, 17) True hasOddEven(7, 19, 5) False Problem 2 - Arrays Write a method that takes an array of integers and print the elements of the array. The header of the method is: public static void displayArray (int [] arr) Write a main method in which you create an array named a of size entered by the user (the size should be even). Then fill the array a with values read from the user. Split the array a into two arrays b and c as follows: a 4 65 23 94 12 56 33 89 34 23 b 4 65 23 94 12 56 33 89 34…Use C Language Airline Reservation System A small airline has just purchased a computer for its new automated reservations system. The president has asked you to program the new system. You are to write a program to assign seats on each flight of the airline's only plane (capacity: 10 seats). Your program should display the following menu of alternatives: Please type 1 for "first class" Please type 2 for "economy" If the person types 1, then your program should assign a seat in the first class section (seats 1-5). If the person types 2, then your program should assign a seat in the economy section (seats 6-10). Your program should then print a boarding pass indicating the person's seat number and whether it is in the first class or economy section of the plane. Use a single-subscripted array to represent the seating chart of the plane. Initialize all the elements of the array to 0 to indicate that all seats are empty. As each seat is assigned, set the corresponding elements of…Exercise 2: Hospital Patients Write a program that computes and displays the charges for a patient’s hospital stay. First, the program should ask if the patient was admitted as an inpatient or an outpatient. If the patient was an inpatient, the following data should be entered: The number of days spent in the hospital The daily rate Hospital medication charges Charges for hospital services (lab tests, etc.) The program should ask for the following data if the patient was an outpatient: Charges for hospital services (lab tests, etc.) Hospital medication charges The program should use two overloaded functions to calculate the total charges. One of the functions should accept arguments for the inpatient data, while the other function accepts arguments for outpatient information. Both functions should return the total charges and display it for the user. After the total charges have been calculated and displayed, write the result to a file,…