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

Complete the attached code and do junit testing can you

Complete the attached code and do junit testing. Can you help with this? Testing class tests Check Date methods serves as a "test plan" for developer's testing. Complete/correct and test/demonstrate using Junit with test ...

Csis program homeworkwrite a program where the user will

CSIS program homework Write a program where the user will enter a number between 1 and 50 representing a state. The program should display the full name of that state. Assume the states are in alphabetical order, that is ...

Engineering programmingi need this now please accurate

Engineering programming I need this now please accurate answers and must be high rated Problem #1 Write a program that asks the user to input the number of miles and convert the miles to kilometers, and then print the ou ...

This assignment introduces you to the perl language and cgi

This assignment introduces you to the Perl language and CGI programming. You will use your scripting and html skills to build a Perl program that will gather user input to then generate a personal webpage. This program w ...

Assignmentcase problem1 - online trivia found on pages

Assignment: Case Problem1 - Online Trivia found on pages 794-795 of your textbook. Complete the web pages and upload them to your 000WebHost account. After uploading the files make sure to update your index.html page to ...

Computerscienceprogram-writeallofthefollowingmainprogramcall

Computer Science Program- Write all of the following: main program: Call a function to open an input file. Call a function to read 3 integers in from the input file. Call a function that will find 3 normalized doubles, g ...

Programming lab assignment set awhat to submitcomplete

Programming Lab Assignment (Set A) What to Submit Complete Problem Solving Steps 1 - 3 (check plan, data analysis, initial algorithm, and refinement algorithm) for the following programs. 1. (Name: lab1a-1.cpp) Write a p ...

The briefyour small development team of ideally three

The Brief Your small development team of (ideally) three people has been asked to implement and test the Human Resource Information System desktop application. Your software product will be a database- backed desktop app ...

Shell programmingyou have created the directory structure

Shell Programming You have created the directory structure and some base files to be used by the Web server and Web site. For the Web site to be created in a production environment, you need to package your commands in a ...

The given machine description will provide the basis for

The given machine description will provide the basis for this assignment. You will create a virtual machine/operating system for the machine described below that will accept programs in the target machine language. The d ...

  • 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

A cola-dispensing machine is set to dispense 9 ounces of

A cola-dispensing machine is set to dispense 9 ounces of cola per cup, with a standard deviation of 1.0 ounce. The manuf

What is marketingbullwhat is marketing think back to your

What is Marketing? • "What is marketing"? Think back to your impressions before you started this class versus how you

Question -your client david smith runs a small it

QUESTION - Your client, David Smith runs a small IT consulting business specialising in computer software and techno

Inspection of a random sample of 22 aircraft showed that 15

Inspection of a random sample of 22 aircraft showed that 15 needed repairs to fix a wiring problem that might compromise

Effective hrmquestionhow can an effective hrm system help

Effective HRM Question How can an effective HRM system help facilitate the achievement of an organization's strate