Using the Design Recipe, write an algorithm for each of the following programming problems, showing all work (i.e., Contract, Purpose Statement, Examples and Algorithm):
5.Write a program that reads two times in military format (e.g., 0900, 1730) and prints the number of hours and minutes between the two times. Note that the first time can come before or after the second time.
6.An online bank wants you to create a program that shows prospective customers how their deposits will grow. Your program should read the initial balance and the annual interest rate. Interest is compounded monthly. Print out the balance for each of the first three months.
7.A video club wants to reward its best members with a discount based on the member’s number of movie rentals and the number of new members referred by the member. The discount is in percent and is equal to the sum of the rentals and the referrals, but it cannot exceed 75 percent. The program shows the user the discount rate awarded.
5.
Algorithm:
TimeDifference(time1,time2):
{
time1Hour=time1/100
time1Min=time1%100
time2Hour=time2/100
time2Min=time2%100
if(time1>time2)
{
diffHour=time1Hour-time2Hour
diffMin=time1Min-time2Min
if(diffMin<0)
{
diffMin=diffMin+60
diffHour=diffHour-1
}
}
else
{
diffHour=time2Hour-time1Hour
diffMin=time2Min-time1Min
if(diffMin<0)
{
diffMin=diffMin+60
diffHour=diffHour-1
}
}
return(diffHour*60+diffMin)//return difference in minutes
}
6.
Algorithm:
CalculateInterest(balance,rate):
{
for i=1 to 3
{
balance=balance+(balance*rate)
print("Balance after month "+i+" is"+balance)
}
}
7.
Algorithm:
CalculateDiscount(rental,referal):
{
discount=rental+referal
if(discount>75)
discount=75
print(discount)
}
Using the Design Recipe, write an algorithm for each of the following programming problems, showing all...
Please explain each line of code, all code will be in Java. Thank you JKL Restaurant maintains a members’ club for its customers. There are three levels of membership: (1) Basic, (2) Silver, and (3) Gold. A certain member has to be exactly a Basic, Silver, or Gold member at any point in time. Whenever a member spends money at JKL, he/she gets points and as these points are accumulated, one can redeem one or more $20 dining certificates. Each Gold member can...
please I need this, step by step with formulas, avoid using excel.
CASE 33 Security Software, Inc. communication in a highly secure and efficient process. The Market Security Software, Inc. (SSI) was a major provider of application software. The firm was proud to be the number two company in the enterprise firewall market. Firewalls ensure network Security for businesses by determining whether to approve or deny access to corporate networks and applications. They have security software that inspects com- munication...
Read the attached article. Do you feel one style of banking
control is more stable than the other? Why? Does one banking method
minimize market volatility and risk better or is it just packaged
differently? Do you feel the US (Western) Banking system can better
control the patterns of behavior going forward that have caused
economic damage in the past? Should the Fed continue its stimulus
policy, reduce it or abandon it entirely (Google some recent
articles to research this)? (Please...
Read the Article posted below, then answer the following
questions:
1. As a junior member of your company’s committee to
explore new markets, you have received a memo from the chairperson
telling you to be prepared at the next meeting to discuss key
questions that need to be addressed if the company decides to look
further into the possibility of marketing to the BOP segment. The
ultimate goal of this meeting will be to establish a set of general
guidelines...
summatize the following info and break them into differeng key points. write them in yojr own words
apartus
6.1 Introduction—The design of a successful hot box appa- ratus is influenced by many factors. Before beginning the design of an apparatus meeting this standard, the designer shall review the discussion on the limitations and accuracy, Section 13, discussions of the energy flows in a hot box, Annex A2, the metering box wall loss flow, Annex A3, and flanking loss, Annex...
SYNOPSIS The product manager for coffee development at Kraft Canada must decide whether to introduce the company's new line of single-serve coffee pods or to await results from the product's launch in the United States. Key strategic decisions include choosing the target market to focus on and determining the value proposition to emphasize. Important questions are also raised in regard to how the new product should be branded, the flavors to offer, whether Kraft should use traditional distribution channels or...
Comprehensive Income Tax Course: Module 1 4. Randy turned 16 last year and had his first summer job. Even though his parents are claiming him as a dependent he wants to file a return in order to get his refund. He receives his W-2 and decides he can do his own return using form 1040-EZ. Which of the following information is not found on a Form W-2? a) The taxpayer’s Social Security number b) The taxpayer’s wages, tips and other...
CASE 20 Enron: Not Accounting for the Future* INTRODUCTION Once upon a time, there was a gleaming office tower in Houston, Texas. In front of that gleaming tower was a giant "E" slowly revolving, flashing in the hot Texas sun. But in 2001, the Enron Corporation, which once ranked among the top Fortune 500 companies, would collapse under a mountain of debt that had been concealed through a complex scheme of off-balance-sheet partnerships. Forced to declare bankruptcy, the energy firm...
Case: Enron: Questionable Accounting Leads to CollapseIntroductionOnce upon a time, there was a gleaming office tower in Houston, Texas. In front of that gleaming tower was a giant “E,” slowly revolving, flashing in the hot Texas sun. But in 2001, the Enron Corporation, which once ranked among the top Fortune 500 companies, would collapse under a mountain of debt that had been concealed through a complex scheme of off-balance-sheet partnerships. Forced to declare bankruptcy, the energy firm laid off 4,000...
Please read the article and answer about questions. You and the Law Business and law are inseparable. For B-Money, the two predictably merged when he was negotiat- ing a deal for his tracks. At other times, the merger is unpredictable, like when your business faces an unexpected auto accident, product recall, or government regulation change. In either type of situation, when business owners know the law, they can better protect themselves and sometimes even avoid the problems completely. This chapter...