473,659 Members | 2,872 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C++ weight and grams then calculate the cost

6 New Member
Php is Pesos

Assume that the cost for sending a letter from the Philippines to New York is
Php.22.50 for the first 10 grams or less, plus Php.5.75 for each additional gram beyond ten, plus a tax of 3%.
............... ........... IN C++ BaSIC ............... ............... ........
Write a program that reads in the weight of a letter (in grams) and then calculate the cost....
............... ............... ............... ............... ............... ............... ............... ............... ..........

what will be the formula code?
what will be i use?

help me............. ......
Oct 14 '08 #1
1 2024
sicarie
4,677 Recognized Expert Moderator Specialist
Well, the description gave you a lot of information so I would break down the problem like this:

1) calculate the cost (derived formula from description)
2) create UI to gather variables to calculate cost
3) create function to calculate cost using formula from 1 and variables from 2
4) display cost

So, from the description below, do you know how to create a formula to calculate the cost? How would you do this by hand if someone asked you (say in a Math class) for a general formula to calculate this?

Assume that the cost for sending a letter from the Philippines to New York is
Php.22.50 for the first 10 grams or less, plus Php.5.75 for each additional gram beyond ten, plus a tax of 3%.
PS - please use periods only as necessary in the English language, strung long over multiple lines they make posts difficult to read. Thanks!
Oct 14 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
325
by: Ace | last post by:
Hello, I am trying to write a tool which calculates a html page weight. Suppose I have a html page which has 5 image references (each image has 10KB size), 1 CSS file of 10KB size. The total result this exe should return is 60KB. I am using htmldocument object to read each element in a html doc but not sure how to get the weight of those depencies.
1
18529
by: Don Leverton | last post by:
Hi Folks, I *can* calculate the Gross Profit Percentage where both the Cost and SellPrice are known, using the formula: (SellPrice - Cost) / SellPrice = GPP eg ($24.92 - $14.95) / $24.92 = 40% But I wanted to do the reverse of that....to calculate the SellPrice, where only Cost and the desired GPP are supplied. I was struggling with my high-school math, and having a heck of a time with
4
6364
by: Rich_C | last post by:
I'm sure this is very simple, but I have very little experience with javascript -- and what I do know isn't helping me here. I have a simple form where users can enter a quantity (qty) and cost (cost). Users can dynamically add rows to the table so I don't know how many rows might need to be calculated. I need to calculate the total (qty * cost) and put that number in a table cell (or read only input box). I also need to sum the...
3
2234
by: chyaf | last post by:
Ok, am new in this and have an assignment. I've read all I had to read and have been searching through the net and still don't have an answer, it may be simpler than I think.... How can I calculate tax? The idea is I'm creating a program that will calculate tax to an item. So far we've seen the basic arithmetic operands and I'm not sure if I just write 6% of item cost... If anyone can guide me I'd really appreciate it. Thanks!
3
6180
by: PamelaB | last post by:
I am trying to calculate the year end cost basis of equities held. I have downloaded all the transactions (purchases and sales) for the year and have them in a table. I need to calculate the value of each equity at year end using a First in First Out method. Does anyone have experience with this and any advice as to how to begin?
3
4095
by: sharma1985 | last post by:
Hi all, i m working on a bioinformatics problem. Regarding that i would like to know about the perl programming. I also like to know that how could i calculate the Isoelectric point and Molecular weight of a protein sequence. Please reply me as soon as possible. Thank you
1
1948
by: scan87 | last post by:
Can someone please, please help me in finding the slotuion of the following problem: The cost of one-day travel cards for adult customers on the metro system is based on which zones they cover and is summarised in the following table: Zone Cost 1 1.70 1 & 2 3.70 1, 2 & 3 4.70 1, 2, 3 & 4 6.00 1,...
3
11791
by: gator6688 | last post by:
I have to write a program that asks for a cost-per-item, number of items purchased, and a discount rate. Then it should calculate the total cost, tax due, and amount due. I have to use the formulas: total cost = number of items * cost-per-item total cost (discounted) = total cost - (discount rate * total cost) tax due = total cost * TAXRATE amount due = total cost + tax due I am going to put what I have so far. Any suggestions would be...
7
10232
by: jamesnkk | last post by:
Hi, Although this question may not directly link to Access, but I think it a common question to those developer.so hope you could suggest a solution. How do I get the average cost for Item sold, so I could calculate the Profit.- Same Product item could bought from different suppliers, different suppliers have different cost price or buying price. There is only 1 standard selling price, In order to calculate the profit, I would take...
0
8427
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8332
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,...
0
8851
Oralloy
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...
0
8746
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8525
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7356
agi2029
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...
1
6179
isladogs
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...
0
5649
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();...
0
4335
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.