5)Booksellers has a book club that awards points to its customers based on the number of books purchased each month. The points are awarded as follows: • If a customer purchases 0 books, he or she earns 0 points. • If a customer purchases I book, he or she earns 5 points. • If a customer purchases 2 books, he or she earns 15 points. • If a customer purchases 3 books, he or she earns 30 points. 60 pointe
Q: et A denote the event "the mark for the Quiz". Let B denote the event "the mark for the…
A: Lets see the solution.
Q: Interest Rates Savings accounts state an interest rate and a compounding period. If theamount…
A: EXPLANATION Below is the answer for the given question. Hope you understand it well. If you have any…
Q: Nested-if structure Book Club Memberships Yes No Non Student 300 200 Student 60 50 Write a…
A: A required program is as follows, #include <iostream> using namespace std; int main() {…
Q: Consider yourself driving with 60 miles/hour in a city that has only grid like streets, and your GPS…
A: Java Code: // Include the necessary header files. import java.io.*; import java.util.Random; import…
Q: use visual basic Depreciation to a Salvage Value of 0 . For tax purposes an item may be depreciated…
A: Design
Q: A barber shop has a barber,a barber chair and a waiting room with 5 chairs.When a barber finishes…
A: Semaphore is a non-negative and shared variable between threads. Semaphore is used for process…
Q: C++ Program /** * Problem 1: Simple Selection * * You have a red lottery ticket showing ints a, b,…
A: #include <iostream> using namespace std;//function definition int redTicket(int a, int b, int…
Q: Lecture Activity 4.3: Flowcharting (Selection Structure) Given is GROSS_PAY. Draw a flowchart that…
A: Please upvote/like. I am providing you the correct answer below.
Q: C++ Mobile Service ProviderModify the program in Problem 5 so that it also displays how much…
A: Code:
Q: LAB 7-5 Desk-CIleck The code shown in Figure 7-45 should display the numbers 2, 4, 6, 8, 10, and 12.…
A: To Desk check the given code. The given code is for (int number = 2; number < 12; number +=…
Q: Write a program that takes the income of an employee and calculates the corresponding net income and…
A: Since no coding language is mentioned, I have picked Python. Now let's move on to the code. I have…
Q: Write a program that calculates the damage inflicted by a weapon against a target. The user will…
A: Actually, program is an executable software that runs on a computer.
Q: in coral language A year in the
A: EXPLANATION: - The function named OutputLeapYear takes an integer parameter and displays the result…
Q: A retail company assigns a $5000 store bonus if monthly sales are more than $100,000; otherwise a…
A: Since no programming language is mentioned, I am using python. Algorithm: Start Read sales of…
Q: 7) Solving quadratic equation program Let's consider the general formula of a quadratic equation :…
A: Required: Python program to solve the quadric equation. Required code with comments for…
Q: Bad News Bearers Introduction There is some bad news to be delivered, and X has taken on the…
A: Answer: Step 1(INTRODUCTION) This is a basic programming problem named "Jospehus Circle" Since…
Q: 33. If the product AB is defined and AB is a zero matrix, then either A or B is a zero matrix.
A: Given: 33. Determine whether the statement are TRUE or FALSE. Write TRUE if the Statement is True…
Q: 8. Pizza Mario owns a pizzeria. Mario makes all of his pizzas from 10 different ingredients, using 3…
A: This program is written in Python. Please correct the indentation as per the screenshot, if it's…
Q: 4.19 LAB: The UCSB surroundings tour guide! Learning Objectives In this lab, you will Use Boolean…
A: Here I have created the function named get_destination(), in this function I have used nested…
Q: An Auto Insurance Program Example - Write a program to determine the cost of an automobile insurance…
A: Program approach: Import Scanner package for input. Create a class. Create the main method. Create…
Q: Assume that sentence is a variable of type String that has been assigned a value. Assume furthermore…
A: Step 1 : declare two variable sentence and firstWord Step 2 : create Scanner class object sc Step 3…
Q: Complete the following sentence. operators are operators that compare one or two logical values, and…
A: The different type of operator are Relational Logical Arithmetic
Q: C Code The salary of a company is paid according to working hours: Within 4 hours, including 4…
A: Algorithm: Start Read number hours hrs Initialize wages to 0 if hrs>0 and hrs<=4 calculate…
Q: Problem Statement: A 4th grader is having trouble with Permutation and Combination problem in…
A: Solution with output given below
Q: Write a program that prompts the user to enter the account’s present value, monthly interest rate,…
A: The code has been rectified of the mistakes present in it and is working fine now. Included…
Q: In coral language please A year in the modern Gregorian Calendar consists of 365 days. In reality,…
A: coral language
Q: C++ A dice game called "21" It is a variation on BlackJack where one player plays against the…
A: Write a C++ program that will find the output according to the conditions given in the question and…
Q: The 24-point card game involves picking any four cards from 52 cards, as shown in Figure 10.20. Note…
A: EXPLANATION Below is the program for the given question. Hope you understand it well. If you have…
Q: An Auto Insurance Program Example - Write a program to determine the cost of an automobile insurance…
A: Program Explanation – Import the essential java libraries. Declare the class named as Main.…
Q: 5)Booksellers has a book club that awards points to its customers based on the number of books…
A: Sample Response: //C++ program to print the number of points awarded for book purchase#include…
Q: 4.19 LAB: The UCSB surroundings tour guide! Learning Objectives In this lab, you will…
A: We have to write a python program to designate people the places according to the distance entered…
Q: Bus Loading Problem. You are in charge of filling busses with passengers at a bus terminal. Each bus…
A: In Jаvа, we use semарhоre in the threаd synсhrоnizаtiоn. It is used tо соntrоl ассess…
Q: 4-5 A Girl Scout needs to calculate the total dollar amount of her cookie orders. User input should…
A: Given :- 4-5 A Girl Scout needs to calculate the total dollar amount of her cookie orders. User…
Q: C++ Summary When you borrow money to buy a house, a car, or for some other purpose, you repay…
A: In this program, you need to take 3 input values from user for loan amount, interest rate and…
Q: Revise Exercise 6.28 (Craps is a popular dice game played in casinos. Write a program to play a…
A: #Always specify which language we have to #solve and it is solved in python import…
Q: Let S(x,y) be the statement "student x likes soft drink y" , where the domain for x consists of all…
A: Here it is given that- x- all students at the school. y- all drinks S(x,y)= student x likes soft…
Q: 1. Function The Fibonacci sequence is a series of numbers where a number is the addition of the last…
A: class Main { static int calculateSum(int n) { if (n <= 0) return 0;…
Q: PYTHON CODING A retail company assigns a $5000 store bonus if monthly sales are more than…
A: First create the function for the store bonus which will take the current sales as the input and…
Q: c. A program that continuously accepts policy holders' data until a sentinel value has been entered,…
A: ANSWER:-
Q: Smajors['CS'] = 'Computer Science'; //Line 1 Smajors['MTH'] = 'Mathematics'; I/Line 2 echo "The two…
A: Answer : A mistake was found in line number 3 ie. Line 3.
Q: Language C++ It has been observed by management that some faculty member at the university…
A: Program #include <iostream>using namespace std; // function with 2 parametersint absent(int…
Q: P2 (70%). Assuming that horizontal position is 0, expand the program you developed in P1 in a way…
A: %%%% part2.m %%%%% clc % Assume initial projectile positions % and Initial velocity are…
Q: A retail company assigns a $5000 store bonus if monthly sales are more than $100,000; otherwise a…
A: Decision Structure: It decides the direction of the flow of program execution.A decision control…
Q: Nested-if structure Book Club Memberships Yes No Non Student 300 200 Student 60 50 Write a…
A: Note: No langauge is mentioned, therefore answering the given question in python. # Input the…
Q: 1. Calculate the Overtime Pay for 5 Service men Enter the Service man Name, Enter the Type of…
A: The answer is given below:-
Q: Write a program to request for the names of four faculty members and number times he/she has…
A: Question given: This program calculate faculty's total salary. It deducts some amount from base…
Q: (Card Shuffling and Dealing) Modify the program you developed in Exercise 17.23 so thatit deals a…
A:
Q: Problem 3: Friends and Relations Select/write a solution to each of these problems using relational…
A: in XOR, when a XOR b XOR c XOR d XOR e is true any one or three or five is true case 1: when any 1…
Q: Mobile Service ProviderModify the program in Problem 5 so that it also displays how much package A…
A: The code is corrected and the savings for all the packages(A,B and C) are displayed.
write a
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
- Problem D: Different Dice Game Consider the following game for two players: The first player rolls a pair of dice of fair six-sided dice. If the two dice show different numbers, the player's score is the larger of the two numbers. Otherwise, the player's score is the sum of the two numbers. At this point, the player is asked if they want to remove their lower die and re-roll one die. If they say no, the player keeps her score and their turn is over. If they say yes, then they roll one more die and the number showing on this die replaces the lower of the original two rolls. Then these two dice rolls are scored accordingly. (For example, if the initial roll was a 2 and 5, if the player doesn't roll again, she gets 5 points. If she does roll again and obtains a 4, her score is still 5. If she rolled again and obtained a 6, her score would be a 6. If she rollwed again and obtained a 5, her score would be a 10.) The second player goes after the first, doing the exact same steps as the first…Language C++ Assuming all Ghanaians who are at least 18 years can choose between going to school or learning a trade. GHC 100 is invested every month for a person who chooses to go to school by the government till the person attains age 30 years provided he/she completes university. If he/she does not complete university, the payment is stopped at the time he/she exited. If the person chooses to learn a trade, the government pays GHC 2000 as apprentice fee to the madam or master who will take the person as an apprentice, and invest GHC 70 a month till age 30 years. If the person does not complete the apprenticeship, the payment is stopped at the time he/she exited. Remember that persons who are less than 18 years or 30years and above do NOT qualify to enroll on this program. You are to write a c++ program for the above scenario. Your program should ) request a person’s name, age, what he/she wants to do (go to school or learn a trade), time of exit if any and disqualify the person if…C++ Summary When you borrow money to buy a house, a car, or for some other purpose, you repay the loan by making periodic payments over a certain period of time. Of course, the lending company will charge interest on the loan. Every periodic payment consists of the interest on the loan and the payment toward the principal amount. To be specific, suppose that you borrow $1,000 at an interest rate of 7.2% per year and the payments are monthly. Suppose that your monthly payment is $25. Now, the interest is 7.2% per year and the payments are monthly, so the interest rate per month is 7.2/12 = 0.6%. The first month’s interest on $1,000 is 1000 X 0.006 = 6. Because the payment is $25 and the interest for the first month is $6, the payment toward the principal amount is 25 - 6 = 19. This means after making the first payment, the loan amount is 1,000 - 19 = 981. For the second payment, the interest is calculated on $981. So the interest for the second month is 981 X 0.006 = 5.886, that is,…
- 4.21 LAB: Leap year - functions A year in the modern Gregorian Calendar consists of 365 days. In reality, the earth takes longer to rotate around the sun. To account for the difference in time, every 4 years, a leap year takes place. A leap year is when a year has 366 days: An extra day, February 29th. The requirements for a given year to be a leap year are: 1) The year must be divisible by 4 2) If the year is a century year (1700, 1800, etc.), the year must be evenly divisible by 400 Some example leap years are 1600, 1712, and 2016. Write a program that takes in a year and determines whether that year is a leap year. Your program must define and call the following function. The function should return True if the input year is a leap year or False otherwise.def is_leap_year(user_year) Here is code so far. I am stuck on this one. It is failing out on the 2: Unit testkeyboard_arrow_up 0 / 2 is_leap_year(1913) 3: Unit testkeyboard_arrow_up 0 / 3 is_leap_year(1600) 4:…C++ A dice game called "21" It is a variation on BlackJack where one player plays against the computer trying to get 21 or as close to 21 without going over. Here are the rules of the game: You will play with dice that have numbers from 1 to 11. To win, the player or the computer has to get to 21, or as close as possible without going over. If the player or computer goes over 21, they instantly lose. If there is a tie, the computer wins. Starting the game: The player is asked to give the computer a name. For now, we'll simply call the computer opponent, "computer." The game starts with rolling four dice. The first two dice are for the player. These two dice are added up and the total outputted to the screen. The other two dice are for the computer. Likewise, their total is outputted to the screen. Player: If a total of 21 has been reached by either the player or the computer, the game instantly stops and the winner is declared. Otherwise, the player is asked if they…Interest Rates Savings accounts state an interest rate and a compounding period. If theamount deposited is P, the stated interest rate is r, and interest is compounded m timesper year, then the balance in the account after one year is P⋅(1+rm)m. For instance, if$1000 is deposited at 3% interest compounded quarterly (that is, 4 times per year), thenthe balance after one year is1000⋅(1+.034)4=1000⋅1.00754=$1,030.34.Interest rates with different compounding periods cannot be compared directly.The concept of APY (annual percentage yield) must be used to make the comparison. TheAPY for a stated interest rate r compounded m times per year is defined byAPY=(1+rm)m−1.(The APY is the simple interest rate that yields the same amount of interest after oneyear as the compounded annual rate of interest.) Write a program to compare interestrates offered by two different banks and determine the most favorable interest rate. SeeFig. 4.24.
- 6.23 LAB: Leap year - functions A year in the modern Gregorian Calendar consists of 365 days. In reality, the earth takes longer to rotate around the sun. To account for the difference in time, every 4 years, a leap year takes place. A leap year is when a year has 366 days: An extra day, February 29th. The requirements for a given year to be a leap year are: 1) The year must be divisible by 4 2) If the year is a century year (1700, 1800, etc.), the year must be evenly divisible by 400 Some example leap years are 1600, 1712, and 2016. Write a program that takes in a year and determines whether that year is a leap year. Ex: If the input is: 1712 the output is: 1712 is a leap year. Ex: If the input is: 1913 the output is: 1913 is not a leap year. Your program must define and call the following function. The function should return True if the input year is a leap year or False otherwise.def is_leap_year(user_year) Use Python, please.(Card Shuffling and Dealing) Modify the program you developed in Exercise 17.23 so thatit deals a five-card poker hand. Then write functions to accomplish each of the following:a) Determine whether the hand contains a pair.b) Determine whether the hand contains two pairs.c) Determine whether the hand contains three of a kind (e.g., three jacks).d) Determine whether the hand contains four of a kind (e.g., four aces).e) Determine whether the hand contains a flush (i.e., all five cards of the same suit).f) Determine whether the hand contains a straight (i.e., five cards of consecutive facevalues)C++ programming It has been observed by management that some faculty member at the university demonstrates a lackadaisical attitude toward work. They seldom go to class yet at the end of each month they receive full salary. Management has decided that GHs 200, 300, 400, and 500 will be deducted from a faculty’s salary if he/she offends once, twice, third time and forth time respectively in a month. This means that if a faculty member offends once in a month GHs 200 will be deducted, if a faculty member offends twice in a month, GHs 500 (i.e. 200+300) will be deducted, if a faculty member offends three times in a month GHs 900 (i.e.200+300+400), will be deducted and if a faculty member offends four times in a month GHs 1,400 (i.e. 200+300+400+500). Assuming all faculty members are on a flat salary rate of GHs 2500. a. Write a program to request for the names of four faculty members and number times he/she has absented him/herself from class. One of them should have absented him/herself…
- C++ Bianca is preparing special dishes for her daughter’s birthday.It takes her a minutes to prepare the first dish, and each following dish takes b minutes longer than the previous dish. She has t minutes to prepare the dishes.For example, if the first dish takes a = 10 minutes and b = 5, then the second dish will take 15 minutes, the third dish will take 20 minutes, and so on.If she has 80 minutes to prepare the dishes, then she can prepare four dishes because 10 + 15 + 20 + 25 = 70.Write a program that prompts the user to enter the values of a, b, and t, and outputs the number of dishes Bianca can prepare.Programming Problem 3 – Broken GPS Consider yourself driving with 60 miles/hour in a city that has only grid like streets, and your GPS is broken. The specifications of the problem are: • With (x, y) as the coordinates of the car, consider the initial position (0,0). • At each intersection, the only directions available are North, South, East or West • The GPS is broken, and it chooses the direction randomly at each intersection, which happens every 5 minutes • The assumption is that the car has the same speed at all times, including when it changes direction and turns. Write a program that calculates the direct distance from the initial point to the location point of the driver after one hour of driving (i.e. the distance between two points). Java PrograIn coral language please A year in the modern Gregorian Calendar consists of 365 days. In reality, the earth takes longer to rotate around the sun. To account for the difference in time, every 4 years, a leap year takes place. A leap year is when a year has 366 days: An extra day, February 29th. The requirements for a given year to be a leap year are: 1) The year must be divisible by 4 2) If the year is a century year (1700, 1800, etc.), the year must be evenly divisible by 400 Some example leap years are 1600, 1712, and 2016. Write a coral program that takes in a year and determines whether that year is a leap year. If the input is 1712, the output is: 1712 is a leap year. If the input is 1913, the output is: 1913 is not a leap year.