Welcome to Dream.In.Code
Getting Java Help is Easy!

Join 86,270 Java Programmers. There are 1,875 online right now! Ask your question and get quick answers from Dream.In.Code experts. Join the #1 programming help community on the internet! Registration is fast and FREE... Join Now!

Chat LIVE With a Java Expert
Powered by LivePerson.com

Register to Make This Box Go Away!

Im sure thi is really easy but i need help

 
Reply to this topicStart new topic

Im sure thi is really easy but i need help

rh3883
post 7 May, 2008 - 03:43 PM
Post #1


New D.I.C Head

*
Joined: 7 May, 2008
Posts: 3



ok i need a to make two simple programs from
The first program can be a while , for , switch, or a do while loop
1.
Output
This progeam allows you to enter a list of positive integers(terminated by a -1) then displays the largest value, smallest value, and average of the list of numbers, not including the final (negative) value that ends the list.

Please enter a positive integer, or a -1 to quit.
100
Please enter a positive integer, or a -1 to quit.
50
Please enter a positive integer, or a -1 to quit.
75
Please enter a positive integer, or a -1 to quit.
-1
For the 3 numbers you entered
the largest value = 100
the smallest value = 50
and the average is = 75



2. Else If Loop
Output

Enter the price of an item
(from 25 cents to a dollar in 5- cent uncremenst
85
you bought an item for 85 cents and gave me a dollar
so your change is
0 quarters
1 dime and
1 nickel


User is offlineProfile CardPM
Go to the top of the page
+Quote Post


rgfirefly24
post 7 May, 2008 - 03:50 PM
Post #2


D.I.C Head

Group Icon
Joined: 7 Apr, 2008
Posts: 135

Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.

Please post like this:

Thank you for helping us helping you.
User is online!Profile CardPM
Go to the top of the page
+Quote Post

rh3883
post 7 May, 2008 - 03:56 PM
Post #3


New D.I.C Head

*
Joined: 7 May, 2008
Posts: 3

QUOTE(rgfirefly24 @ 7 May, 2008 - 03:50 PM) *

Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.

Please post like this:

Thank you for helping us helping you.


I would but all my stuff is at school and i dont have the softwar on my home computer. i really need help.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

pbl
post 7 May, 2008 - 04:34 PM
Post #4


D.I.C Addict

Group Icon
Joined: 6 Mar, 2008
Posts: 843

QUOTE(rh3883 @ 7 May, 2008 - 03:56 PM) *

[I would but all my stuff is at school and i dont have the softwar on my home computer. i really need help.


Seems you have internet at home... so you could post here..
All the JDK (software you need) is available at www.sun.com


User is offlineProfile CardPM
Go to the top of the page
+Quote Post

herefishyfishy
post 7 May, 2008 - 05:50 PM
Post #5


New D.I.C Head

*
Joined: 1 May, 2008
Posts: 15

For the first, you could use both branching and looping, for the second, the same thing, but a little more complex.

I'm not going to give you code for this until you post your code.

P.S. Try to use a more descriptive title for your post next time and use proper capitalization.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

rh3883
post 8 May, 2008 - 04:51 PM
Post #6


New D.I.C Head

*
Joined: 7 May, 2008
Posts: 3

[code]
public class Project1
{
public static void main(String[] args)
{

System.out.println("This program allows you to enter a list of poistive integers");
System.out.println("(terminated by a -1) then displays the largest value, ");
System.out.println("smallest value, and average of the list of numbers, not");
System.out.println("including the final (negative) value that ends the list.");
System.out.println("");
int number;
System.out.println("PLease enter a positive integer, or a -1 to quit.")
number = SavitchIn.readlineInt();
}
}
[code]

This is all i got. i just started learning. The teacher had been absent and the teacher's aid (student teaching class) sucks. The only requirement is it has to have the output i wrote and has to be a while loop. If you could help it would be greatly appreciated. Than You.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 5/16/08 10:33AM

Live Java Help!

Java Tutorials

Reference Sheets

Java Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month