Ask Question, Ask an Expert

+1-415-315-9853

info@mywordsolution.com

Ask Programming Language Expert

prepare down a program which computes the cost of a long distance call. The cost of call is determined according to the given rate schedules.

a) A call made between 8:00 AM and 6:00 PM is billed at the rate of 6 rupees per minute.

b) A call made before 8:00 AM or after 6:00 PM is charged at the rate of 3.75 rupees.

According to this schedule, if a call begins at any time between 8:00 AM and 6:00 PM and it ends after 6:00 PM then it will be charged at rate of 6 rupees per minute for the time before 6:00 PM and for the rest of the time the rate will be 3.75 rupees per minute. For illustration if a call begins at 5:55 PM and ends up at 6:05 PM then charges on this call will be 48.75 (30 rupees for first 5 minutes and 18.75 rupees for rest of the time).

Likewise if a call begins at the time before 8:00 AM but ends after 8:00 AM then it will be charged at the rate of 3.75 rupees for the time before 8:00 AM and for remaining minutes after 8:00 AM the rate will be 6 rupees per minute. For illustration if a call begins at 7:49 AM and ends at 8:01 AM the charge on that call will be 47.25 rupees (41.25 for first 11 minutes and 6 rupees for last minute).

The input to the program will includes of the time the call started, and the length of call in minutes. The output will be the cost of call. The time is to be input in 24-hours notation, thus the time 1:30 PM is input as 13:30. The time will be input using two variables of type int, one used for hour and other employed for minutes. The number of the minutes for length of the call will as well be input as a value of type int.

After completing the program test it for following inputs. (First try to judge the answers manually and then compare the values with the program output).

Input
Output
Start time
Length
Cost

8: 21 10 60
17:55 10
7:49 12
6:00 30
8:00 5

Programming Language, Programming

  • Category:- Programming Language
  • Reference No.:- M9526

Have any Question? 


Related Questions in Programming Language

Write a program where you create a class called bankaccount

Write a program where you create a class called BankAccount. The BankAccount class should contain a String to store the customer name and a double to store the account balance. The BankAccount class should have two const ...

1 show how to transform a three-address code sequence into

1. Show how to transform a three-address code sequence into one in which each defined variable gets a unique variable name. 2. Determine the types and relative addresses for the identifiers in the following sequence of d ...

Assignemntbulla non-gui based java application that

Assignemnt •A non-GUI based Java application that fulfills the requirements listed below. All output should be to the console/standard output. •Salespersons for Big State Books receive a commission of ten percent for eac ...

Assignmenta student had to make a decision on how to be

Assignment A student had to make a decision on how to be paid. The student could accept a straight $10/hour or take 10 cents for the first hour, but have the hourly wage double each hour. That is, the student would make ...

Assignment lispoverviewthe purpose of this assignment is

ASSIGNMENT: LISP Overview The purpose of this assignment is for you to gain some experience designing and implementing LISP programs. This assignment explores only a few of the many interesting LISP features. This assign ...

Create an application for a company to save and display

Create an application for a company to save and display customer information. Begin with designing class named Person with the following properties: · LastName (String) · FirstName (String) · Address (String) · City (Str ...

Frans virtual fruit standuse the concepts and scenario from

Frans Virtual Fruit Stand Use the concepts and scenario from Assignment to help Fran's Virtual Fruit Stand increase the functionality of its online shopping cart. When a customer checks out, the shopping cart must store ...

Design and implement your own simple class to represent any

Design and implement your own simple class to represent any household item of your choice (toaster, fan, hair dryer, piano ...) Your class should have a constructor, one additional method and at least one member variable ...

Object-oriented design for the ordering systemyou will

object-oriented design for the ordering system You will continue development of the object-oriented design for the ordering system. The new content this week will be the Sequence and Collaboration Diagram for the system. ...

Program 1write a program that reads and processes data

Program 1 Write a program that reads and processes data about quarterly rainfall for one year. Your program should ask the user to enter rain fall amounts for each of the four quarters in the year. You must use a looping ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

WalMart Identification of theory and critical discussion

Drawing on the prescribed text and/or relevant academic literature, produce a paper which discusses the nature of group

Section onea in an atwood machine suppose two objects of

SECTION ONE (a) In an Atwood Machine, suppose two objects of unequal mass are hung vertically over a frictionless

Part 1you work in hr for a company that operates a factory

Part 1: You work in HR for a company that operates a factory manufacturing fiberglass. There are several hundred empl

Details on advanced accounting paperthis paper is intended

DETAILS ON ADVANCED ACCOUNTING PAPER This paper is intended for students to apply the theoretical knowledge around ac

Create a provider database and related reports and queries

Create a provider database and related reports and queries to capture contact information for potential PC component pro