Write a program that reads two times in military format

Assignment Help Programming Languages
Reference no: EM131395971

Assignment

Using the Design Recipe, write an algorithm for each of the following programming problems:

The straight-line method for computing the yearly depreciation in value D for an item is given by the following formula:

depreciation_formula D = (P - S) / Y

where P is the purchase price, S is the salvage value, and Y is the number of years the item is used. Write a program that takes as input the purchase price of an item, the expected number of years of service, and the expected salvage value. The program should then output the yearly depreciation for the item.

A government research lab has concluded that an artificial sweetener commonly used in diet soda pop causes death in laboratory mice. A friend of yours is desperate to lose weight but cannot give up soda pop. Your friend wants to know how much diet soda pop it is possible to drink without dying as a result. Write a program to supply the answer. The input to the program is the amount of artificial sweetener needed to kill a mouse, the weight of the mouse, and the desired weight of the dieter. Assume that diet soda contains 1/10th of 1% artificial sweetener. Use a named constant for this fraction.

Write a program that inputs the name, quantity, and price of three items. Output a bill with a tax rate of 6.25%.

Write a program that helps a person decide whether to buy a hybrid car. Your program's inputs should be:

The cost of a new car
The estimated miles driven per year
The estimated gas price
The efficiency in miles per gallon
The estimated resale value after 5 years

Compute the total cost of owning the car for five years. (For simplicity, we will not take the cost of financing into account.) Obtain realistic prices for a new and used hybrid and a comparable car from the Web, and use today's gas price and 15,000 miles driven per year.

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.

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 balances after the first three months.

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.

Reference no: EM131395971

Questions Cloud

Point elasticity of demand at the price : Suppose you own a movie theater and most of your costs (the film rental, security, the land rental, etc.) are independent of how many people show up. What is likely to be the point elasticity of demand at the price you decide to charge?
Discuss the development of bilbo baggins character : Discuss the development of Bilbo Baggins' character. What qualities are used to describe him at the beginning of the story? What qualities emerge during the course of the story? What causes the changes in his character?
Higher unemployment for some of the workers : An increase in minimum wage must lead to higher unemployment for some of the workers and lower OJT for all workers." Evaluate.
Represents consumer income : A demand curve and supply curve for lawnmowers are given respectively as follows: QD = 72 ? 2P + 2MQS = 2P. Where M represents consumer income. Suppose that last year, consumer income was M = $150.
Write a program that reads two times in military format : 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.
Write a brief description of this problem : Identify a problem in your community or workplace that you'd like to solve - Write a brief description of this problem and an idea for your solution.
What can you conclude about the three groups : Farmer Marc, a Shakespearean devotee, delivered a plea at the County Faire, asking three different groups to lend him unshelled corn.- The numbers of bushels offered by the farmers are listed. What can you conclude about the three groups?
Explain the economic opportunity act : Explain The Economic Opportunity Act of 1964 and the programs created under it are classified as institutional programs. Increasing opportunities for the poor was the main concern of this act which proves that the basis of this act fits the model ..
Create a text document containing user names and passwords : Additionally, create a simple text document containing the user names and passwords. Tie this into the authentication on the login page.

Reviews

Write a Review

Programming Languages Questions & Answers

  Program which converts fahrenheit to celsius.

Create the following program which converts Fahrenheit to Celsius. Your program must have the following functions: Read integer Fahrenheit temperatures from the user. You need to check whether the input is the correct one or not. If the user enters ..

  Write program to accept long integer number

Write down the program which contains function calories() which is to accept long integer number total and address of integer variables pizza, chips apples and mustard.

  Write a program that decides if a number x is in the matrix

Write a program that decides if a number X is in the matrix. Let the user enter the size of the matrix n, the content, and the number X to search. Display the result of your search in the screen. While testing your program for submission, make sur..

  Develop html5 pages themed on manchester

Design and develop three HTML5 pages themed on Manchester. The pages should be optimised for delivery on a tablet.

  Create logic for application to produce report

Create the logic for application which produces report which lists each event number, host name, validated date, meal code, entrée name, number of guests.

  Write program to allow two users to play tic-tac-toe

Write a program that will allow two users to play tic-tac-toe. The program should ask for moves alternately from player X and player O.

  Analyze the need for waterfall and agile methodologies

Analyze the need for waterfall and agile methodologies. Explain the advantages of extreme programming (XP) and analyze the advantages of its application in high-budget short-time projects.

  Generate a salary as a number with two digits

Generate a salary as a number with two digits after the decimal point. The salary for a teacher should be in the range from $40,000 to 70,000.

  Example on message-passing style

Write a procedure that produces independent first-in-first-out queue objects, using a message-passing style.

  Procedure to draw shape of choice

Write a program with a suitable procedure to draw shape of your choice. Your program must then call the procedure 10 times to draw the shape.

  Description of how virtual applications will be delivered

Description of how virtual applications or desktops (or both) will be delivered to the user's desktops and a description of how you will provide disaster recovery in this infrastructure

  Express javascript code that called to validate text-field

Write a JavaScript function to validate a text-field on a form that is to hold an email address.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd