i am studying a computer engineering and i started taking programming
using C++ since month
i have question i think it`s easy for you all *prof.programme r* but
it`s bit diffecult for me plzz i need your help. (: this is the
question:
** A new telephone communication company needs a billing calculation
program. The cost of a call is based on the following three inputs that
should be entered by the user, and they are explained as follows.
1. Call Destination. Destination rates are calculated as shown below.
Note that only the cost of a local call is specified (should be
declared as constant); all other rates are calculated in terms of the
local rate.
a. For local calls ( L ), the cost is AED 0.35 / min
b. For national calls ( N ), the cost is 170% of a local call
c. For intra-continental calls ( I ), the cost is 210% of a local call
d. For inter-continental calls ( O ), the cost is 300% of a local call
2. Call Time. There are two rates based on the call time as shown
below, a normal rate and a discounted rate (should be defined as
constant). Although input times are shown in a 12-hour based clock, it
is emphasized that a 24-hour based clock should be used in your
program.
a. If the call is between 6 am and 9 pm, no discounts are applicable
b. If the call is between 9 pm and 6 am, a discount of 20% on the call
rate is in effect
3. Call Duration. Once the rate of a call is calculated as based on the
first two factors, it is multiplied by the call duration (given in
minutes) for determining the cost of a call.
Write a program that collects the aforementioned input for a specified
number of calls, calculates the cost of each input call, and displays
output information accordingly to the user. The program should accept
input in triplets. If some discount is applied, the program should
display such information along with the cost of the call. The following
input/output example helps make clear how the program interacts with
the user. Note that input by the user is shown in normal font, and that
computer-generated text is shown in boldface. 4 2513
sara wrote:
i am studying a computer engineering and i started taking programming
using C++ since month
i have question i think it`s easy for you all *prof.programme r* but
it`s bit diffecult for me plzz i need your help. (: this is the
question:
[homework assignment snipped]
That's not a question. It's a homework assignment. We won't do your homework
for you. Show what you have so far and add some information about what
problem you've got.
In article <11************ *********@m7g20 00cwm.googlegro ups.com>,
"sara" <me**********@h otmail.comwrote :
i am studying a computer engineering and i started taking programming
using C++ since month
i have question i think it`s easy for you all *prof.programme r* but
it`s bit diffecult for me plzz i need your help. (: this is the
question:
** A new telephone communication company needs a billing calculation
program. The cost of a call is based on the following three inputs that
should be entered by the user, and they are explained as follows.
1. Call Destination. Destination rates are calculated as shown below.
Note that only the cost of a local call is specified (should be
declared as constant); all other rates are calculated in terms of the
local rate.
a. For local calls ( L ), the cost is AED 0.35 / min
b. For national calls ( N ), the cost is 170% of a local call
c. For intra-continental calls ( I ), the cost is 210% of a local call
d. For inter-continental calls ( O ), the cost is 300% of a local call
2. Call Time. There are two rates based on the call time as shown
below, a normal rate and a discounted rate (should be defined as
constant). Although input times are shown in a 12-hour based clock, it
is emphasized that a 24-hour based clock should be used in your
program.
a. If the call is between 6 am and 9 pm, no discounts are applicable
b. If the call is between 9 pm and 6 am, a discount of 20% on the call
rate is in effect
3. Call Duration. Once the rate of a call is calculated as based on the
first two factors, it is multiplied by the call duration (given in
minutes) for determining the cost of a call.
Write a program that collects the aforementioned input for a specified
number of calls, calculates the cost of each input call, and displays
output information accordingly to the user. The program should accept
input in triplets. If some discount is applied, the program should
display such information along with the cost of the call. The following
input/output example helps make clear how the program interacts with
the user. Note that input by the user is shown in normal font, and that
computer-generated text is shown in boldface.
#include <cassert>
#include <iostream>
enum Destination { Local, National, IntraContinenta l, InterContinenta l };
int cost_of_call( Destination dest, int time, int duration )
{
// insert code here
}
int main()
{
assert( cost_of_call( Local, 0, 0 ) == 0 );
cout << "Working So Far!\n";
}
Put code in the "cost_of_ca ll" function until you can make the program
print out "Working So Far!". Once you get that, post back here what you
did and I'll help you with the next step. (You can email me if you like.)
--
There are two things that simply cannot be doubted, logic and perception.
Doubt those, and you no longer*have anyone to discuss your doubts with,
nor any ability to discuss them.
"sara" writes:
>i am studying a computer engineering and i started taking programming
using C++ since month
i have question i think it`s easy for you all *prof.programme r* but
it`s bit diffecult for me plzz i need your help. (: this is the
question:
It's hard for us to understand what your problem is. Perhaps you are just
bewildered by all the factoids the program contains? If so, just start
writing some code. Use up the factoids as the need arises. You will
probably end up with a kludgy thing you don't like. If you have time left,
you can then rewrite the thing to something you do like. For example, you
can do it for a call of duration 13.8 minutes on a local call. Right? Get
that going, then forge ahead. It looks like two functions *might* be a good
idea, one to compute the base rate and another to compute the discount. The
main program can call these, as appropriate.
** A new telephone communication company needs a billing calculation
program. The cost of a call is based on the following three inputs that
should be entered by the user, and they are explained as follows.
1. Call Destination. Destination rates are calculated as shown below.
Note that only the cost of a local call is specified (should be
declared as constant); all other rates are calculated in terms of the
local rate.
a. For local calls ( L ), the cost is AED 0.35 / min
b. For national calls ( N ), the cost is 170% of a local call
c. For intra-continental calls ( I ), the cost is 210% of a local call
d. For inter-continental calls ( O ), the cost is 300% of a local call
The instructor probably wants you to use a switch statement there.
2. Call Time. There are two rates based on the call time as shown
below, a normal rate and a discounted rate (should be defined as
constant). Although input times are shown in a 12-hour based clock, it
is emphasized that a 24-hour based clock should be used in your
program.
Don't forget the "emphasized " thing.
<snip>
You will have to make some assumptions where the exercise is not clear. Ex,
a call that starts in one rate and ends in another rate. Rounding, you
probably want to eliminate charges such as 12.333333 AEDs. Go ahead and
make assumptions, this is not rocket science.
Ok thnx i will try to solve it then i`ll send it to get ur help
:( This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Scott |
last post by:
Not sure if this is the right place to post this or not, but I am in the
process of trying to find a Web Hosting/Isp Billing system that is
reasonable in price and uses Access or SQL Server for a backend DB. I have
found a couple that seem to do what I want, but are using FILEMAKER for
their DB. Looking for something that will handle reoccuring billing as well
as per project billing. Keeping up with client info, etc.... Also needs to...
|
by: ML |
last post by:
hello
i need to write an sql which calculates # of billing cycles for an
order for which ive order start and end date. the first invoice will
be cut on the order start date. Also if i apply a coupon for lets say
one month (30 days) to that order i need to calculate how many billing
cycles that coupon will apply to.
ive start and end date of coupon ina diff table for that order
for eg: if an order was started on 1/15 and ended on 4/14...
|
by: Dream Web Host |
last post by:
Hi,
I am creating a Web hosting billing program and require a script which
will output the date next month, obviously this can be difficult due to
different numbers of days in different months. It needs to be able to
differ between monthly payments, quarterly and also yearly.
Any tips?
Rob
|
by: Jeremy Weiss |
last post by:
I'm trying to build a database that will handle the monthly billing needs of
a small company. I'm charting everything out and here's what I see:
table for customers
sub table to track payments received.
No biggie, right? Well, here's my problem. I don't know how to tell access
to modify everyone's account balance each month. And I can't just always
assume that their monthly bill is $16 just because their balance is $16. If
I do that...
|
by: Michiel Alsters |
last post by:
Hello everybody,
I hope anybody can help me. I'll try to give a brief overview of my
problem. I have running a program that performs a heavy calculation.
To give the user feedback what the program is doing I show a window
which contains a progress bar and a label. At some point during the
execution the state of the calculation is changed, so I want to let
the user know this.
I have placed the creation of the form in a seperate thread...
| |
by: jlf |
last post by:
Need serious help with a calculation. The fields are based on a query that has linked many different tables. The calculation I currently have is:
=sum()/((+)*(Piecesnum]))
It is giving a calculated outcome, but an incorrect one. I am basically trying to get the QtyProduced to divide into the combined runtime+downtime*piecesnum to get a sum of efficiency. I've tried many different combinations of this calculation, but have had not luck....
|
by: Signeg |
last post by:
Hey guys,
I have some work for university and i never used C++ in my life so i'm kinda lost..
But i've still managed to write something woth it.
But too bad for me the prog does compile and lunch propely, but once i enter "-1" for the second while, nothing more is happening..
This is the code
http://rafb.net/paste/results/rHKKIF94.html
Could you guys tell me whats wrong because it looks okay for me :(
|
by: 60325 |
last post by:
This is the page where I collect the data in drop-down boxes with
values of 1-10 and send it to a submitted page to do calculations.
Example:
Employee1 TeamScore(1-10)
Employee2 TeamScore(1-10)
Employee3 TeamScore(1-10)
Employee4 TeamScore(1-10)
Then I submit this page with all the values in TeamScore for every
employee and I want to
perform a calculation based on the values in the drop-down and a
|
by: ImortalSorrow |
last post by:
Hey, I hope you can help me with a prog i'm making. Everything is working well except a part where i want to repeat the riddle if the answer isnt correct. here's the bit of the bode where i need help
System.out.println("Riddle:blablabla");
riddleanswer = scanner.nextLine();
if (riddleanswer.equals("2") || riddleanswer.equals("two")) {
System.out.println("Great!");
} else {
...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |