Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: assignment brainfreeze

  1. #1
    Junior Member
    Join Date
    Jun 2014
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default assignment brainfreeze

    Design a program that will read a file of sales records and produce a sales report. Each record in the file contains a customer’s ID, name, a sales amount, and a validated GST code. The GST code is to be applied to the sales amount to determine the sales tax due for that sale, as shown below.

    GST Code GST Rate
    0
    1
    2 0%
    5%
    10%

    The report is to print a heading “SALES REPORT”, and detail lines listing the customer’s ID, name,
    sales amount, sales tax, and total amount due including sales tax.
    Is assignment
    sofar:pseudo code
    SalesReport
    Read customer file
    Get TaxCode
    Get GSTAmount SalesTax
    Calculate SalesTax
    Process customer record
    Read cust name, Sales Amount, TaxCode
    If TaxCode = 0 Then
    Let tax amt = 0
    ElseIf tax code = 1 Then
    Let tax amt = Sales Amount * 0.05
    ElseIf tax code = 2 Then
    Let tax amt = Sales Amount * 0.10
    EndIf
    Let TotalSalesAmount = SalesAmount+Tax amt
    Then Display “CustomerID,Name,SalesAmount,SalesTax,TotalSalesAm ount”
    End


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,074
    My Mood
    Mellow
    Thanks
    184
    Thanked 652 Times in 639 Posts

    Default Re: assignment brainfreeze

    Welcome to the forum! Please read this topic to learn how to post code in code or highlight tags and other useful info for new members.

    Ask a question. We can't do it for you.

  3. #3
    Member Ada Lovelace's Avatar
    Join Date
    May 2014
    Location
    South England UK
    Posts
    411
    My Mood
    Angelic
    Thanks
    27
    Thanked 61 Times in 55 Posts

    Default Re: assignment brainfreeze

    sofar:pseudo code
    SalesReport
    Read customer file
    Get TaxCode
    Get GSTAmount SalesTax
    Calculate SalesTax
    Process customer record
    Read cust name, Sales Amount, TaxCode
    If TaxCode = 0 Then
    Let tax amt = 0
    ElseIf tax code = 1 Then
    Let tax amt = Sales Amount * 0.05
    ElseIf tax code = 2 Then
    Let tax amt = Sales Amount * 0.10
    EndIf
    Let TotalSalesAmount = SalesAmount+Tax amt
    Then Display “CustomerID,Name,SalesAmount,SalesTax,TotalSa lesAm ount”
    End
    You have been given an algorithm of sorts in the description. Implement each line in Java and add bits to it
    to make it work correctly. Do one small part at a time, test that and make sure it works before moving on to
    the next part. Ask if you need help.

    Wishes Ada xx
    If to Err is human - then programmers are most human of us all.
    "The Analytical Engine offers a new, a vast, and a powerful language . . .
    for the purposes of mankind
    ."
    Augusta Ada Byron, Lady Lovelace (1851)

Similar Threads

  1. Behaviour of shortcut assignment and normal assignment for float
    By rakeshkr2 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: April 20th, 2014, 02:54 AM
  2. Help with my assignment.
    By javapol in forum Java Theory & Questions
    Replies: 1
    Last Post: February 8th, 2013, 07:20 AM
  3. assignment troubles polymorphism (guide for assignment included)
    By tdawg422 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: October 8th, 2011, 10:01 AM
  4. Can someone help with my Assignment
    By damustk in forum Object Oriented Programming
    Replies: 1
    Last Post: March 14th, 2011, 03:32 PM
  5. Replies: 1
    Last Post: February 22nd, 2010, 07:20 AM