Jump to content


Java Tasks


  • Please log in to reply
3 replies to this topic

#1 lehart1

lehart1

    Newbie

  • Members
  • Pip
  • 4 posts
  • Gender:Male
  • Interests:boxing, it support, java programming

Posted 19 November 2011 - 02:18 PM

Currently doing a degree in IT Support and have managed to do the first 11 questions in my first Java assignment but am struggling with the final four questions.. Any help or tips much appreciated :)

Program 11:
You have to replace the glass in a broken window.  Create a program that asks for the length and width of the required glass in inches, and then asks for the thickness of glass required in mm (give the choices of 3, 5 or 8mm thickness).  The program should then show the area of the window along with the full price it would cost to replace.  Show the price with and without VAT at 20%.
Glass thickness is 3mm = 5p per square inch
Glass thickness is 5mm = 7p per square inch
Glass thickness is 8mm = 12p per square inch

Program 12
You decide to try and calculate how well you will do in assessment 1A, 1B and 1C.
Design and build a program to allow you to enter an estimated percentage for each of the three assessment parts. The program should output first an average mark from the three marks, and finally an estimated final percentage mark calculated from the inputs.
(Assignment 1A is weighted at 25% , Assignment 1B is weighted at 25% , Assignment 1C is weighted at 50%)
Output a message after the final grade stating what grade you would get with that final percentage.
Distinction = 70 to 100
Merit  = 60 to 69
Pass  = 40 59
Fail = 0 to 39

Program 14:
Design, write and test a program which asks the user to enter the name and price of three clothing items that they wish to purchase.  Show the subtotal total price.  If the subtotal price is over 50 then give a 12% discount and show the new subtotal.
Add VAT @ 20% to the subtotal.
Add 4.75 for shipping.
Show the customer a summary of what they have ordered, the breakdown of prices including the final total order price.

#2 Kraicheck

Kraicheck

    Advanced Member

  • Members
  • PipPipPip
  • 884 posts
  • Gender:Male
  • Location:Belgium

Posted 20 November 2011 - 07:31 PM

With what part of the questions are you having problems?

#3 lehart1

lehart1

    Newbie

  • Members
  • Pip
  • 4 posts
  • Gender:Male
  • Interests:boxing, it support, java programming

Posted 21 November 2011 - 07:33 AM

View PostKraicheck, on 20 November 2011 - 07:31 PM, said:

With what part of the questions are you having problems?
just basically all of it to be honest, i have done the start and put the doubles i will be using but after that i am stuck.

#4 sholmes

sholmes

    Member

  • Members
  • PipPip
  • 11 posts
  • Gender:Male
  • Location:Long Lake, NY
  • Interests:Delphi & Java

Posted 21 November 2011 - 06:31 PM

most of these require you to capture keyboard input. Have you mastered this concept yet?

example:

import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.io.IOException;
public class Order {
    
    public static void main(String[] args)
    
   {
    
    InputStreamReader convert = new InputStreamReader(System.in);
    BufferedReader stdin = new BufferedReader(convert);
    
    String nameItem1;
        
    System.out.println("Enter Item 1 Name: ");
    nameItem1 = stdin.readLine();
    
    //... more code here
    
    
   System.out.println("Name = " + nameItem1);
  
    }
}

Google java + "capture keyboard input"  

There are a number of classes people have already buit that allow you to capture any of the types from the keyboard (String, int, float, etc)

You really shouldn't be asking someone to do your homework for you.  maybe ask for simple direction, like i am giving you here - to help give you a boost

Shane
Delphi

type
  TTest1 = class
  public
    constructor Create;
    destructor Destroy; override;
    procedure Method1;
  end;


JAVA

public class Test1 {
  public Test1() {
    //
  }

  public void method1() {
    //
  }
}