473,545 Members | 2,047 Online
Bytes | Software Development & Data Engineering Community
+ 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 2064
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
5831
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. Could someone show me how to do what I need? Thanks, Dick Moores rdm@rcblue.com
17
6496
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 interest rate I, and annual service charge S. Your algorithm would then compute and print out the total amount of interest earned during the year and...
10
1560
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
5689
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 of a Microsoft book, "Visual Basic,Net Step by Step" in Chapter 18. All but the bottom two subroutines will open a text file, and then allow me...
11
1536
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 HMAC-SHA1 function. I did the tests with the following: void icv_Calculation_test(char p_output) { char msgtest="what do ya want for nothing?"; char...
12
4503
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 results for longer strings. I can't find what's wrong. Can anybody help?
6
25353
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 1953 I checked the algorithm it is very correct.
4
4186
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 package that may contain such a thing? Or, in general, where I should be looking when looking for a piece of Python code that may have already been...
4
40442
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 algorithm to print all the combinations like:
0
7475
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...
0
7664
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. ...
0
5981
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...
1
5341
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...
0
4958
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...
0
3463
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...
0
3446
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1022
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
715
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.