473,473 Members | 2,169 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

algorithm that compute and print

1 New Member
These is a question from previous examination paper example.

Write your answers in the space provided below the question
Determine the marks for a specific question before you answer the question
A program is required to read a customer’s name, a purchase amount and a tax code.
The tax code has been validated and will be one of the following:
0 – tax exempt (0%)
1 – state sales tax only (3%)
2 – federal and state sales tax (5%)
3 – special sales tax (7%)
Design the algorithm for a program that must compute the sales tax and the total amount
due, and print the customer’s name, purchase amount, sales tax and total amount due. A
case structure MUST be used.

My solution would be:

tax?


tax exempt state sales federal and special sales tax
tax only state sales tax


0% 3% 5% 7%




print:customer’s name, purchase amount, sales tax and total amount due.



HELP
Oct 4 '07 #1
2 2063
Killer42
8,435 Recognized Expert Expert
The experts on this site are more than happy to help you with your problems but they cannot do your assignment/program for you. Attempt the assignment/program yourself first and post questions regarding any difficulties you have or about a particular function of the code that you don't know how to achieve.

Please read the Posting Guidelines and particularly the Coursework Posting Guidelines.

Then when you are ready post a new question in this thread.

MODERATOR

P.S. Please don't post questions in the Articles area. I have moved this one back to the forum.
Oct 5 '07 #2
jamesd0142
469 Contributor
Here is an example of a case structure:

courtesy of killer42...

Expand|Select|Wrap|Line Numbers
  1. Select Case test.Text
  2.   Case Is >= 20
  3.     Hopperfullpic(0).Visible = True
  4.     Hopper1pic(0).Visible = False
  5.     Hopper2pic(0).Visible = False
  6.     Hopper3pic(0).Visible = False
  7.     Hopper4pic(0).Visible = False
  8.   Case 15 To 19
  9.     Hopperfullpic(0).Visible = False
  10.     Hopper1pic(0).Visible = True
  11.     Hopper2pic(0).Visible = False
  12.     Hopper3pic(0).Visible = False
  13.     Hopper4pic(0).Visible = False
  14.   Case 10 To 14
  15.     Hopperfullpic(0).Visible = False
  16.     Hopper1pic(0).Visible = False
  17.     Hopper2pic(0).Visible = True
  18.     Hopper3pic(0).Visible = False
  19.     Hopper4pic(0).Visible = False
  20.   Case 5 To 9
  21.     Hopperfullpic(0).Visible = False
  22.     Hopper1pic(0).Visible = False
  23.     Hopper2pic(0).Visible = False
  24.     Hopper3pic(0).Visible = True
  25.     Hopper4pic(0).Visible = False
  26.   Case 1 To 4
  27.     Hopperfullpic(0).Visible = False
  28.     Hopper1pic(0).Visible = False
  29.     Hopper2pic(0).Visible = False
  30.     Hopper3pic(0).Visible = False
  31.     Hopper4pic(0).Visible = True
  32.   Case Else
  33.     ' You didn't say what to do in this situation.
  34. End Select
Oct 5 '07 #3

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

Similar topics

52
by: Dick Moores | last post by:
I need to figure out how to compute pi to base 12, to as many digits as possible. I found this reference, <http://mathworld.wolfram.com/Base.html>, but I really don't understand it well enough....
17
by: savesdeday | last post by:
In my beginnning computer science class we were asked to translate a simple interest problem. We are expected to write an algorithm that gets values for the starting account balance B, annual...
10
by: Daniel Mark | last post by:
Hello: Does anyone know what the size of this class? class T { char a; double b; char c; class T *p
1
by: hamil | last post by:
I am trying to print a graphic file (tif) and also use the PrintPreview control, the PageSetup control, and the Print dialog control. The code attached is a concatination of two examples taken out...
11
by: Fernando Barsoba | last post by:
Hi all, I very much need your help here guys.. I'm working on a IPSec implementation, and when almost finished, I found a considerable problem. I'm sending a particular array + a key to a...
12
by: wjb131 | last post by:
hi all, below you find my simple python version of MD2 algorithm as described in RFC1319 (http://rfc1319.x42.com/MD2). It produces correct results for strings shorter than 16 Bytes and wrong...
6
by: aarklon | last post by:
Hi folks, I found an algorithm for calculating the day of the week here:- http://www.faqs.org/faqs/calendars/faq/part1/index.html in the section titled 2.5 what day of the week was 2 august...
4
by: mkppk | last post by:
MICR = The line of digits printed using magnetic ink at the bottom of a check. Does anyone know of a Python function that has been written to parse a line of MICR data? Or, some financial...
4
by: DAXU | last post by:
Hi, I know it is very easy, but I just can't fngure out the algorithm. For example: I have these: string a={"1","2"}; string b={"a","b" "c"}; string c={"d","e","f"}; How to write an...
0
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...
0
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,...
0
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...
1
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...
0
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,...
1
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...
0
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 ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.