Concept explainers
Modify
Trending nowThis is a popular solution!
Chapter 4 Solutions
Java: An Introduction to Problem Solving and Programming (8th Edition)
Additional Engineering Textbook Solutions
Starting Out with Java: From Control Structures through Data Structures (4th Edition) (What's New in Computer Science)
Starting Out With Visual Basic (8th Edition)
Introduction To Programming Using Visual Basic (11th Edition)
Java How to Program, Early Objects (11th Edition) (Deitel: How to Program)
SURVEY OF OPERATING SYSTEMS
Web Development and Design Foundations with HTML5 (8th Edition)
- Please give me correct solution.arrow_forwardCreate a program that outputs a result for a student based upon the mean grade of eight module grades and a project mark. The rules for the marks are the same as for the above exercises. The pass mark is 40 and a valid grade is in the range [0,100]. These rules apply to individual module grades and to the project. The result is computed as follows: If any individual module grade or the project grade is not valid then the result is “ERROR”. If any single grade (for a module or the project) is less than 40, the result is “FAIL”. If the mean mark for the modules is less than 40, the result is “FAIL”. If the criteria for “ERROR” and “FAIL” do not apply, and either the mean grade or the project grade is less than 50, the result is “PASS”. If the criteria for “ERROR”, “FAIL” and “PASS” do not apply, and either the mean grade or the project grade is less than 70, the result is “MERIT”. If the mean module grade and the project grade are greater than or equal to 70, the result is “DISTINCTION”.…arrow_forwardWrite a program that computes the earnings per shift for a babysitter. A babysitter charges $10 per hour before noon and $15 after noon. The program reads the starting time in hours and minutes and the ending time in hours and minutes. All times are between 8:00 am, and 7:59 pm, using a 12-hour clock. For example, you should consider hour 8 as 8 am and hour 6 as 6pm. The program should check the validity of the inputs as follows. 1) Hours are from 0-11 (0 for noon). 2) Minutes are from 0-59. 3) The start time must be before noon. 4) The end time must not be before 1pm. The program should display specific warnings regarding the above when the user submits invalid input; the program should prompt the user to re-enter the times again. The program should output the total hours worked and the total earnings per shift. Example: >9h 20m to 6h 15m You have worked 8 hours and 55 minutes in this shift, earning $120.417 Important Notes: Please do this in C++ Programming Do not use any…arrow_forward
- Write a C program to simulate tossing a “fair” coin. Allow the user to enter the number of tosses. Print the number of tosses that yield heads and the number of tosses that yield tails. What should be the percentage distribution of heads and tails? (Use the function rand_int)arrow_forwardJack is the head of his section. He looked tensed due to some reason. One of his friends asks him the reason. He says that he has to find the average marks out of 50 of 7 subjects because his section mentor has given him this task. But he does not know how to do this. Then his friend said that he will give him a program in C for finding the average marks of students. So, write this program in C.arrow_forwardWrite a program that will ask a user to input grades in Integral Calculus, Computer Programming and Physics. A grade of greater than or equal to 70 means PASSED and a grade of below 70 means FAILED. If the user has a rating of PASSED from all three subjects, the program must return a status of REGULAR. If the user has only one FAILED rating, the program must return a status of PROBATIONARY and if the user has two or more FAILED rating, the program must return a status of DISMISSED. Assume that the user will only input numerical values for their grades. 1. Type the following code on your Python script. 1 integral_calc = float(input('Input your grade in Integral Calculus: ')) 2 phys=float(input('Input your grade in Physics: ')) 3 comp_prog=float(input('Input your grade in Computer Programming: ')) 4 if (integral_calc >= 70 and phys >= 70 and comp_prog >= 70): 5 print('Congratulations, you are REGULAR!") 6 elif((integral_calc < 70 and phys < 70) or (integral_calc<70 and comp_prog < 70) or…arrow_forward
- Let's modify the program from this section so that the user can supply the interest rate. For very small interest rates, it may take a very long time for the balance to double. Assume the user can't wait for more than twenty years. Stop adding interest when the balance has doubled or twenty years have elapsed. 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 finaldoubleTARGET=2*INITIAL_BALANCE; doublebalance=INITIAL_BALANCE; intyear=0; Scannerin=newScanner(System.in); System.out.print("Interest rate in percent: "); doublerate=in.nextDouble(); // TODO: Count the years required for the investment to double // but no more than 20 years /* Your code goes here */ System.out.println("Year: "+year); System.out.printf("Balance: %.2f%n", balance); }arrow_forwardTeachers in most school districts are paid on a schedule that provides a salary based on their number of years of teaching experience. For example, a beginning teacher in the Lexington School District might be paid $30,000 the first year. For each year of experience after this first year, up to 10 years, the teacher receives a 2% increase over the preceding value. Write a program that displays a salary schedule, in tabular format, for teachers in a school district. The inputs are: 1. Starting salary 2. Annual percentage increase 3. Number of years for which to print the schedule Each row in the schedule should contain the year number and the salary for that year An example of the program input and output is shown below: Enter the starting salary: $30000 Enter the annual % increase: 2 Enter the number of years: 10 Year Salary 1 30000.00 2 30600.00 3 31212.00 4 31836.24 5 32472.96 6 33122.42 7 33784.87 8…arrow_forwardWrite a c program that display the water invoice price on the screen as follows, according to the first and last indicator values entered from the keyboard. (The price per cubic meter of water is 0.912857 TL). Sample Work:: Enter the first indication: 838 Enter the last indicator: 859 consumption amount: 21 Consumption amount: 19.17. Wastewater price (50 percent): 9.58 Total: 28.75 TLarrow_forward
- It is Question: Creating a program for a market. The system can send a family card to a consumer and accept a discount of 0% (no discount), 5%, or 10% based on the following rules: The default discount choice is "no discount." There is no discount for unregistered users. A family card is not supplied to an unregistered user. If a registered user has spent more than $1000 on past food purchases and has less than 19 shopping sessions, they will receive a 5% discount. If a registered user spent more than $1000 in prior grocery shopping sessions and had at least 20 grocery shopping sessions, they would receive a 10% discount. Only registered users who spend over $1000 or have at least 20 shopping sessions receive a family card. My program works just fine. It meets the conditions in the question. But my problem is I can't run Junit tests no matter how hard I try. According to my program, can you write Junit test and post the Junit test codes?arrow_forwardWrite a program that takes in a year and you need to determines whether that year is a leap year..arrow_forwardPlease answer it in Python Offer a program that knows how to find the solution of the jackpot price game in a way effective. it's up to you to choose a number at random, and it's up to your program. to guess it. You must write him 'g' if the number he guessed is too large, 'p' if the number is too small and 'b' if he guessed the right number. The number of trials is not limited. The program should always be able to guess the right number fast enough Example 1: Think of a number and I'll try to guess! Ready? Press Enter... Hmm.. Is it 15? p Hmm.. Is it 35? g Hmm.. Is it 31? g Hmm.. Is it 24? g Hmm.. Is it 20? g Hmm.. Is it 19? g Hmm.. Is it 17? p Hmm.. Is it 18? b I won! Example 2: Think of a number and I'll try to guess! Ready? Press Enter... Hmm.. Is it 4? p Hmm.. Is it 69? g Hmm.. Is it 49? g Hmm.. Is it 7? p Hmm.. Is it 19? p Hmm.. Is it 38? g Hmm.. Is it 25? g Hmm.. Is it 20? b I won! Example 3: Think of a number and I'll try to guess! Ready? Press Enter... Hmm.. Is it 46? g Hmm..…arrow_forward
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning