• 0

Java project....in a bind and need help


Question

So here it is. Between work and internet security project I have dropped the ball and managed to let this project get away from me.

But I am in a huge bind and need someone to help me. There is some definite financial arraignments that can be made if anyone is willing to take this on.

Basically this is what I am working on:

Given the economic conditions, businesses have sprouted offering money for unwanted jewelry, antiques and collectibles to people in need of cash. The service makes exchanging goods for cash easy and discrete.

You have been tasked by ?Cash for Metals? to write a program which will help calculate the amount they will pay customers for their precious metals. Customers mail an envelope filled of metals to Cash for Metals, who create a proposal for purchasing of the metals from the customer. Below are the program requirements:

Read the entire assignment before proceeding to coding ? be sure to follow the implementation notes!

1. First, some introductory lines are printed welcoming the user to the program:

*** ***

*** Welcome to Cash for Metals Calculator!!! ***

*** ***

2. The program will begin asking for information about the customer and the metals they have submitted as follows.

a. Customer?s Name (String)

b. Weight of Gold (double)

c. Weight of Platinum (double)

d. Weight of Silver (double)

3. Processing of Data

a. Create a unique 8 digit number (int) to identify the customer (use the Math random function)

b. The following conversion rates will be used for calculation of the amount of money offered for each metal the customer has submitted and a total amount

Gold $400.50/ounce

Platinum $500.50/ounce

Silver $6.25/ounce

4. Display the data

a. Display the customer?s name

b. Display the customer?s ID

c. Display the amount of money to be offered for each metal

d. Display the total amount of money to be offered to the customer

5. Ask the user if they wish to enter another customer ? assume the user will enter either ?Yes? or ?No? (use the equalsIgnoreCase when checking the user?s response). If yes, you should start inputting values again (step 2). If no, continue to step 6.

6. Display a summary of the user?s input for all customers as follows:

a. Total weight for each metal from all customers

b. Total dollar amount of money to be offered for each metal for all customers

c. Grand total for all metals for all customers

Display Values

Note that different values must displayed in different ways. Here are some examples

Display Item Format Examples

Metal Weight Round to 2 decimals, one digit left of decimal 325.40

0.56

Dollar Amount Dollar sign, round to 2 decimals, one digit left of decimal $200.34

$45.50

$0.35

And example of what the output should be:

*** ***

*** Welcome to Cash for Metals Calculator!!! ***

*** ***

Enter the customer name > Joe Schmoe

Enter the weight of gold > 12

Enter the weight of platinum > .5

Enter the weight of silver > 4.6

*** Customer Summary ***

Customer Name: Joe Schmoe

Customer ID: 91816383

Gold Total: $4806.00

Platinum Total: $250.25

Silver Total: $28.75

Total Offer: $5085.00

Would you like to enter another customer? > No

***Grand Total Summary ***

Gold Totals: 12.00 ounces, $4806.00

Platinum Totals: 0.50 ounces, $250.25

Silver Totals: 4.60 ounces, $28.75

Grand Total: $5085.00

If anyone is willing then I would be so grateful and I can concentrate on my IS project a bit more. Please post here or send me a PM.

Link to comment
Share on other sites

18 answers to this question

Recommended Posts

  • 0

I suppose everything is going to be on console?

But well, it seems "do-able" to me if you have some basic knowledge of JAVA and Object oriented programming knowledge.

Personally, I won't be helping you do the entire project but i am more than will to help if you try it yourself first and maybe if you are stuck or something, ask the SPECIFIC question here and I'll do my best to give as much advices/help as i can.

What you stated above is the requirements for the entire project and i will really suggest that you try it yourself first.

Maybe someone might just give it go if they need some quick bucks... Good luck! =)

Just my 2 cents worth.

Cheers mate.

Link to comment
Share on other sites

  • 0
I suppose everything is going to be on console?

But well, it seems "do-able" to me if you have some basic knowledge of JAVA and Object oriented programming knowledge.

Personally, I won't be helping you do the entire project but i am more than will to help if you try it yourself first and maybe if you are stuck or something, ask the SPECIFIC question here and I'll do my best to give as much advices/help as i can.

What you stated above is the requirements for the entire project and i will really suggest that you try it yourself first.

Maybe someone might just give it go if they need some quick bucks... Good luck! =)

Just my 2 cents worth.

Cheers mate.

It's not a matter of being stuck it's a matter of time and unfortunately priorities. My IS project seems to be taking up a lot of my time and work is well work. Those may seems like just excuses but I have run out of time and need to turn to someone...anyone....and am willing to sell a little piece of myself and my pride to get it done.

My priorities need a tad bit of re-doing...I know that and I am working on it. Until that happens I am just asking for this.

Link to comment
Share on other sites

  • 0

No one here is going to do this for you.... :/

we will help, but not do it for you.

Sorry but you dont learn from other doing it for you... that is not the point of doing you studies... if you dont have time to do it, arrange an extension, or just fail and do it again...

Link to comment
Share on other sites

  • 0

This is obviously an assignment for a Java class, and an easy one at that. I wouldn't accept money for doing it, and I simply wouldn't do it because it's your assignment.

:rolleyes:

Link to comment
Share on other sites

  • 0
This is obviously an assignment for a Java class, and an easy one at that. I wouldn't accept money for doing it, and I simply wouldn't do it because it's your assignment.

:rolleyes:

I never said it wasn't. I did admit I am in a huge bind and let it slip. I don't mind if you don't want to help ..... but I don't have the time to explain myself.....what I would like is someone who might be willing to help me while I concentrate on my IS project.

To say the least I don't understand java....no matter how easy people say it is. I am not a programmer and I don't want to be.

Edited by M. Seth
Link to comment
Share on other sites

  • 0

I agree, this does appear to be homework. It just doesn't feel very ethical to do this assignment for you. Get your priorities straight. If your "IS Project" is more important than take a failing grade in your class. This is YOUR project that YOU took on, not US.

Link to comment
Share on other sites

  • 0
I agree, this does appear to be homework. It just doesn't feel very ethical to do this assignment for you. Get your priorities straight. If your "IS Project" is more important than take a failing grade in your class. This is YOUR project that YOU took on, not US.

I agree also it isn't ethical.....I hate having to ask this. I don't want to ask this. But when in doubt you can hopefully count on your friends.....I usually can count on people here to help me.

Advice here has always been good.

Link to comment
Share on other sites

  • 0

You said you don't know Java and you don't want to be a programmer. so my question is why did you take this class at the first place?

Link to comment
Share on other sites

  • 0
I agree also it isn't ethical.....I hate having to ask this. I don't want to ask this. But when in doubt you can hopefully count on your friends.....I usually can count on people here to help me.

Advice here has always been good.

So do it yourself then.

I do not know anyone who got through Uni without some 18 hour days, all nighters and stress. If you can't do it then this course isn't for you.

Cheating like this devalues the education system for yourself and everyone else. It harms the reputation of your uni. This is why people get peeved. I didn't slog my ass off only to find my degree is worth the same as some joker who cheated his way through.

Link to comment
Share on other sites

  • 0
I bet you buy your essays online as well. :rolleyes:

Cheats deserve to fail.

Never once in my life have I ever done that. I worked my ass off on my papers. They were some of the hardest I had but they showed it.

I don't mind what anyone thinks of me......I did this to myself......feel free to preach.....I don't mind it

You said you don't know Java and you don't want to be a programmer. so my question is why did you take this class at the first place?
So do it yourself then.

I do not know anyone who got through Uni without some 18 hour days, all nighters and stress. If you can't do it then this course isn't for you.

Cheating like this devalues the education system for yourself and everyone else. It harms the reputation of your uni. This is why people get peeved. I didn't slog my ass off only to find my degree is worth the same as some joker who cheated his way through.

I work my ass off working around 50 hours a week and doing a second degree. Java and database design is required. Database design was a breeze compared to this. For whatever reason I cannot get my brain to understand the ideas of java.

Link to comment
Share on other sites

  • 0
static long round(double a)

Returns the closest long to the argument.

Seems pretty rubbish how to use it?

I don't see your point.

double a = 1.71;
long b = Math.round(a); // now b = 2;

The behavior is very well documented :

Returns the closest int to the argument. The result is rounded to an integer by adding 1/2, taking the floor of the result, and casting the result to type int. In other words, the result is equal to the value of the expression:

(int)Math.floor(a + 0.5f)

Special cases:

If the argument is NaN, the result is 0.

If the argument is negative infinity or any value less than or equal to the value of Integer.MIN_VALUE, the result is equal to the value of Integer.MIN_VALUE.

If the argument is positive infinity or any value greater than or equal to the value of Integer.MAX_VALUE, the result is equal to the value of Integer.MAX_VALUE.

http://java.sun.com/j2se/1.4.2/docs/api/ja...l#round(double)

You also have floor and ceil in the Math class if you wish to get more control on how the rounding is done.

Link to comment
Share on other sites

  • 0

Ok, this is not finished, need to the rounding (Honestly could not be bothered with) and the recursion, where it asks you for the new customer, I might come back to it if I get a spare minute. (Wasted a lot of time, since started with multiple classes for this, turned out there is no actual need.)

package test;

import java.io.*;
import java.util.*;

public class Calc {

	static Customer[] customers;
	static double gold, platinum, silver, temp, tgold, tplatinum, tsilver, total, id;
	static int CusCount;
	static String name, yesReply, noReply;
	static boolean y, n, reader;

	public static void main (String[] args) {

		System.out.println("****************");
		System.out.println("Welcome to Cash for Metals Calculator!!! ");
		System.out.println("****************\n");

	customers = new Customer[10];
	CusCount = 0;
	yesReply = "Yes";
	noReply = "No";
	reader = true;
	y = true;
	n = true;

	while (reader == true)	{
		 Read();
	}


	System.out.println("*** Grand Total Summary ***");
	System.out.println("Gold Total: " + tgold + " ounces, $" + (tgold*400.50));
	System.out.println("Platinum Total: " + tplatinum + " ounces, $" + (tplatinum*500.50) );
	System.out.println("Silver Total: " + tsilver + " ounces, $" + (tsilver*6.25));
	System.out.println("Total Offer: " + ((tgold*400.50)+(tplatinum*500.50)+(tsilver*6.25)));

	}


public static void Read()	{

	String input = null;
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

	 try {

		   System.out.println("Enter the customer name: ");
		   input = br.readLine();
		   name = input;

		   System.out.println("Enter the weight of gold: ");
		   input = br.readLine();
		   gold = Integer.parseInt(input);

		   System.out.println("Enter the weight of silver: ");
		   input = br.readLine();
		   silver = Integer.parseInt(input);

		   System.out.println("Enter the weight of platinum: ");
		   input = br.readLine();
		   platinum = Integer.parseInt(input);

		   //Customer customer = new Customer(name, gold, silver, platinum);
		   total = gold+silver+platinum;

		   //		 Needs doing!
			id = (((Math.random()) * 100));

		   //customers[CusCount] = customer;
		   //CusCount++;

		   //System.out.println(customer.id);

		} catch (IOException ioe) {
		}

		//for(int i=0; i < CusCount; i++)	{

			/*** Customer Summary ***
			Customer Name: Joe Schmoe
			Customer ID: 91816383
			Gold Total: $4806.00
			Platinum Total: $250.25
			Silver Total: $28.75
			Total Offer: $5085.00*/

			System.out.println("*** Customer Summary ***");
			System.out.println("Customer Name: " + name);
			System.out.println("Customer ID: " + id);
			System.out.println("Gold Total: " + (gold*400.50));
			tgold =+ gold;
			System.out.println("Platinum Total: " + (platinum*500.50));
			tplatinum =+ platinum;
			System.out.println("Silver Total: " + (silver*6.25));
			tsilver =+ silver;
			System.out.println("Total Offer: " + total);


			System.out.println("Would you like to enter another customer?");

			String input2 = null;
			BufferedReader br2 = new BufferedReader(new InputStreamReader(System.in));
			try {
			input2 = br2.readLine();

			if(input2.equalsIgnoreCase(yesReply));
				reader = true;

			if(input2.equalsIgnoreCase(noReply));
				reader = false;


			}
			catch (IOException ioe) {
			}
			//else
			//System.out.println(scores[i] + ", ");

		//}

}	
}

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.