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

  Design logic for application to allow user to enter item

Design the logic for an application that allows a user to enter an ordered item continuously until a sentinel value is entered. After each item, display its price or the message.

  Program to compute perimeter and area of rectangle

Write a program that asks for length L and the width W of a rectangle, then compute perimeter and area of the rectangle.

  Pseudocode to create thread-safe countdownevent by locks

Write pseudocode to implement a thread-safe CountdownEvent using locks and condition variables by implementing the following methods (lists 4 methods) and then "implement a Barrier using a CountdownEvent.

  Write a program to find solutions to the n-queens puzzle

Write a program to find solutions to the n-queens puzzle for various valuesof n. To be specific, test your program for n =4 and n =8.

  How would i write a shell script, change-lines

How would I write a shell script, change-lines, which will substitute a string for a replacement string for each occurance of the string in files specified?

  Advantages and disadvantages of server

One of the features of Javascript that we have been looking at this week is that the code is interpreted within the browser environment, on the client machine.

  Compare using link labeles method

Just to make labels and scores for original graph and its done once for the comparison reasons - refine the Removed graph to take only edges that don't exist (missing and nonexistent) with there link labels

  Application for calculation

Which school had the most kids playing basketball

  Create sql database "chart of accounts" report

A grand total of the balance field will be provided at the end of the report.

  Write a progra whether a number is prime

Write a progra whether a number isPrime(int number) method for testing whether a number is prime. Use this method to find the number of prime numbers less than 10000.

  Write a program to calculate diameter in centimeters

Write a program to compute the diameter in centimeters of steel rod, aluminum rod, adn copper rod, which can withstand a particular compression load.

  Write pseudocode

Write pseudocode that represents the abstract functions of the enqueue and dequeue operations. Define and explain any supplementary information needed by your pseudocode.

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