Concept explainers
You have just purchased a stereo system that cost $1,000 on the following credit plan: no down payment, an interest rate of 18% per year (and hence 1.5% per month), and monthly payments of $50. The monthly payment of $50 is used to pay the interest and whatever is left is used to pay part of the remaining debt. Hence, the first month you pay 1.5% of $1,000 in interest. That is $15 in interest. So, the remaining $35 is deducted from your debt, which leaves you with a debt of $965.00. The next month you pay interest of 1.5% of $965.00, which is $14.48. Hence, you can deduct $35.52 (which is $50 – $14.48) from the amount you owe. Write a
Want to see the full answer?
Check out a sample textbook solutionChapter 2 Solutions
Problem Solving with C++ (10th Edition)
Additional Engineering Textbook Solutions
Java How to Program, Early Objects (11th Edition) (Deitel: How to Program)
Computer Science: An Overview (12th Edition)
Computer Systems: A Programmer's Perspective (3rd Edition)
Starting Out with C++: Early Objects
Absolute Java (6th Edition)
Modern Database Management (12th Edition)
- Scenario As you surely know, due to some astronomical reasons, years may be leap or common. The former are 366 days long, while the latter are 365 days long. Since the introduction of the Gregorian calendar (in 1582), the following rule is used to determine the kind of year: if the year number isn't divisible by four, it's a common year, otherwise, if the year number isn't divisible by 100, it's a leap year. otherwise, if the year number isn't divisible by 400, it's a common year. otherwise, it's a leap year. none of the above year int(input("enter the year")) if (year%4 1-0) and (year%400 -0) or (year % 1000): print (year is common year") else: print(year, is leap year") year= int(input ("enter the year")) if (years !-0) or (year480 1-0) and (year % 1001-0): print(year is common year") else: print(year, "is leap year") D year= int(input("enter the year"))arrow_forwardA flight of stairs has 10 steps numbered 1 to 10 as shown in the figure below. i. How many ways could you climb up the set of stairs, assuming that you can skip any number of stairs with each step, but you must end on step 10 and you can only go up, never down and never remaining on the same step. ii. How many ways could you climb up the set of stairs, assuming you take exactly 4 steps. Again, your staircase climb ends on step 10. JAlthough there are different ways in which you could solve this problem, model the problem as a balls and bins problem for full credit.arrow_forwardAt QT Sugar factory the amounts which go into bag of sugar are supposed to be normally distributed with mean 36 kg and standard deviation 0.1 kg. Once every 30 minutes a bag is selected from the production line, and its contents are noted precisely. If the amount of the bag goes below 35.8 kg or above 36.2 kg, then the bag will be declared out of control. a) If the process is in control, meaning u = 36 kg and o= 0.1 kg, find the probability that the bag will be declared out of control. b) In the situation of (a), find the probability that the number of bag found out of control in an eight-hour day (16 inspections) will be zero. c) In the situation of (a), find the probability that the number of bag found out control in an eight- hour day (16 inspections) will be exactly one. d) If the process shifts so that u =37 kg and o=0.4 kg find the probability that a bag will be declared out of control.arrow_forward
- Craps is a single player dice game, that proceeds as follows:1. the player rolls 2 six-sided dice once if the total is 7 or 11, the player wins if the total is 2, 3 or 12, the player loses otherwise, the game continues, ... see 2 ... 2. the player the continues to roll the dice repeatedly, until ... the total is the same as the original total (from 1), in which case the player wins the total is 7, in which case the player loses Write a function craps using Python that simulates a single game of craps (may be many rolls) and returns 1 if the player wins and 0 otherwise. Sample results examples: >> import random>>> random.seed(0)>>> craps()0 >>> random.seed(1)>>> craps()1 >>> random.seed(2)>>> craps()0 >>> [ (i,random.seed(i),craps()) for i in range(20)][(0, None, 0), (1, None, 1), (2, None, 0), (3, None, 1), (4, None, 0), (5, None,1), (6, None, 0), (7, None, 1), (8, None, 0), (9, None, 0), (10,…arrow_forwardThe United States federal personal income tax is calculated based on filing status and taxable income. There are four filing statuses: single filers, married filing jointly, married filing separately, and head of household. The tax rates vary every year. Table 4.2 shows the rates for 2009. If you are, say, single with a taxable income of $10,000, the first $8,350 is taxed at 10% and the other $1,650 is taxed at 15%. So, your tax is $1,082.50. TABLE 4.2 2009 U.S. Federal Personal Tax Rates Marginal Tax Rate 10% 15% 25% 28% 33% 35% Single $0-$8,350 $8,351-$33.950 $33,951-$82,250 $82,251 - $171,550 $171,551-$372,950 $372,951+ Married Filing Jointly $0-$16,700 $16,701-$67,900 $67.901-$137,050 $137,051 - $208,850 $208,851-$372,950 $372,951+ Married Filing Separately $0-$8,350 $8,351-$33,950 $33,951 - $68,525 $68,526-$104,425 $104,426-$186,475 $186,476+ Head of Household $0-$11,950 $11,951-$45,500 $45,501-$117,450 $117.451-$190,200 $190,201-$372,950 $372.951+ You are to write a program to…arrow_forwardUsing C Languagearrow_forward
- c programing languagearrow_forwardYou have a group of friends coming to visit for your high school reunion, and you want to take them out to eat at a local restaurant. You are not sure if any of them have dietary restrictions, but your restaurant choices are as follows: Joe’s Gourmet Burgers—Vegetarian: No, Vegan: No, Gluten-Free: No Main Street Pizza Company—Vegetarian: Yes, Vegan: No, Gluten-Free: Yes Corner Café—Vegetarian: Yes, Vegan: Yes, Gluten-Free: Yes Write a program that asks whether any members of your party are vegetarian, vegan, or gluten-free, to which then displays only the restaurants to which you may take the group.arrow_forwardLoan negotiation is usually not a straightforward task. A type of loan is the discount installment loan. This type of loan has the following characteristics. Supposing a loan has face value of GHC 1000, interest is 13% and the duration is 24 months. The interest is compounded by multiplying the face value by 0.13 to produce GHC 130. The figure (130) is then multiplied by the loan period of 2 years to give GHC 260 as the total interest owed. This amount is immediately deducted from the face value leaving the customer with only GHC 740. Repayment is then made in monthly equal installments based on the face value. This means that the monthly payment will be GHC 1000 divided by 24 which is approximately 41.67. This method of calculating the monthly repayment is not too bad if the consumer needs only GHC 760 but the calculation is a bit complicated if the consumer needs GHC 1000. a. Write a program that will take 3 inputs 1. The amount the consumer needs 2. The interest rate 3. The duration…arrow_forward
- ASAParrow_forward(Data processing) Your professor has asked you to write a C++ program that determines grades at the end of the semester. For each student, identified by an integer number between 1 and 60, four exam grades must be kept, and two final grade averages must be computed. The first grade average is simply the average of all four grades. The second grade average is computed by weighting the four grades as follows: The first grade gets a weight of 0.2, the second grade gets a weight of 0.3, the third grade gets a weight of 0.3, and the fourth grade gets a weight of 0.2. That is, the final grade is computed as follows: 0.2grade1+0.3grade2+0.3grade3+0.2grade4 Using this information, construct a 60-by-7 two-dimensional array, in which the first column is used for the student number, the next four columns for the grades, and the last two columns for the computed final grades. The program’s output should be a display of the data in the completed array. For testing purposes, the professor has provided the following data:arrow_forwardBLACKJACK DO not use jquery strictly java script Black Jack is a simple card game that is also often called 21. The point of the game is to get a value as close to 21 without going over. A player that obtains the score of 21 with only 2 cards is said to have a Black Jack. Rules of the game: There are 2 types of participants in a game of Black Jack, the dealer and the players. The players play against the dealer and not against each other. In order to win, the player must have a hand value superior to that of the dealer’s. The game starts with each player receiving 2 cards, the dealer receiving 2 cards. Each player has the option to add an additional cards (1 by 1) to his hand (Draw) or to stay with the cards he currently has (Hold). If at any point, the player’s total exceeds 21, he automatically loses the hand (Bust). When all players complete this process, the dealer gets to complete his hand. As long as the dealer’s point total is 16 or less, he must draw a new card. As soon as…arrow_forward
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr