Lost Password?

Go Back   CodeCall Programming Forum > Software Development > Java Help

Unregistered, Check out the Coder Battles in the Announcement and Game forums.

Java Help Java Help forum discussing all Java platforms - J2ME, J2SE and J2EE - as well as relevant standards, APIs and frameworks such as Swing, Servlets, JSPs, Applets, Struts, Spring, Hibernate, ANT, EJB, and other Java-related topics.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-04-2006, 11:06 PM
Sharp Sharp is offline
Newbie
 
Join Date: Oct 2006
Posts: 1
Credits: 0
Rep Power: 0
Sharp is on a distinguished road
Default Who can show me how to do this program?

I am so freaking lost. I am completely new to programming. I bought a java programming book to try and teach myself. This is one of the programs it asks you to make. It doesn't show you how to do it either. I have been able to do all the programs it has requested so far. I'm freakin stumped. It asks you to do this program without using the math operators. any help here would be greatly appreciated. Ill make it worth your time to respond. My e-mail is CastorTroy357@hotmail.com. thanks in advance to anyone that helps.

1)Prompt the user and accept a number from standard input.
2)Prompt the user and accept a symbol character from standard input. The symbol must be either an ^ or an !. If it is neither of these, display an error message and end the program.
3)If the symbol is a !, compute the factorial of the number entered in step 1 and display the result.
4) if the symbol is a ^, prompt the user to enter a second number, and then calculate the 1st number to the power of the 2nd number (similar to tonight's exercise). Display the result.
5) You must use iteration/loops for the factorial and exponent calculations
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 10-04-2006, 11:45 PM
TcM's Avatar   
TcM TcM is offline
Moderator
 
Join Date: Aug 2006
Location: In a technologic world :p
Posts: 8,251
Credits: 0
Rep Power: 74
TcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud of
Default

hmm seems like H.W huh?
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.



To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 10-05-2006, 10:59 AM
Frantic's Avatar   
Frantic Frantic is offline
Learning Programmer
 
Join Date: May 2006
Posts: 91
Credits: 0
Rep Power: 9
Frantic is on a distinguished road
Default

I'd say homework - not book work. This isn't a complex program - just read the chapter of the book. Should be fairly easy to learn and do within a couple of day.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 10-05-2006, 11:25 AM
WingedPanther's Avatar   
WingedPanther WingedPanther is offline
Super Moderator
 
Join Date: Jul 2006
Age: 35
Posts: 2,385
Last Blog:
wxWidgets is NOT code ...
Credits: 662
Rep Power: 27
WingedPanther is a jewel in the roughWingedPanther is a jewel in the roughWingedPanther is a jewel in the roughWingedPanther is a jewel in the rough
Default

Do you know how to compute factorials and integer powers?
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 10-06-2006, 03:30 PM
dirkfirst dirkfirst is offline
Programming Professional
 
Join Date: May 2006
Posts: 338
Credits: 0
Rep Power: 11
dirkfirst is on a distinguished road
Default

Yup, homework. Why don't you post your code and then we can help you solve the problem?
__________________
DirkFirst
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #6 (permalink)  
Old 10-09-2006, 05:48 PM
Lop's Avatar   
Lop Lop is offline
Speaks fluent binary
 
Join Date: May 2006
Posts: 1,148
Credits: 112
Rep Power: 16
Lop will become famous soon enough
Default

Please post whatever you have and we will help you out as best we can.
__________________
Lop
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 10-10-2006, 08:34 PM
icepack's Avatar   
icepack icepack is offline
Programmer
 
Join Date: Jul 2006
Location: North Carolina
Posts: 115
Credits: 12
Rep Power: 9
icepack is on a distinguished road
Send a message via AIM to icepack
Default

break the problem up into smaller problems. (hopefully the book you bought is using java 1.5)

1) and 2), look up how to accept import from the keyboard(hint: Scanner!)
2) in what way would you check(keyword: check) if it's a certain character? think what kind of statement that would use
3) and 4) simply develop seperate cases based on the results of the check.
like:
Code:
if( this is true) then do this
else if (that is true) then do that
5) is just telling you to use a loop to do your calculations, (and not recursively)

look in the java API for methods if your book doesn't lay them out.
http://java.sun.com/j2se/1.5.0/docs/api/

that site can be your best friend sometimes.

and you won't learn much if you ask for all the code and have someone email it. you HAVE to be able to do it on your own, or else completing the exercise is worthless.

good luck!

Last edited by icepack; 10-10-2006 at 08:37 PM. Reason: cause i'm magic
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 10-12-2006, 04:35 PM
John's Avatar   
John John is offline
Co-Administrator
 
Join Date: Jul 2006
Age: 19
Posts: 3,205
Last Blog:
Passwords
Credits: 842
Rep Power: 20
John has much to be proud ofJohn has much to be proud ofJohn has much to be proud ofJohn has much to be proud ofJohn has much to be proud ofJohn has much to be proud ofJohn has much to be proud ofJohn has much to be proud ofJohn has much to be proud of
Send a message via AIM to John
Default

im pretty new to java but for an input box i woud do something like this...
Code:
UserInput = new javax.swing.JOptionPane().showInputDialog("Enter a value");
and since the input is a String use, you need to convert it to int inorder to perform mathamatical operations on it, so possable something like

Code:
x = Integer.parseInt( UserInput );
then just use a for loop to do the iterations

but i know very little regarding java so dont quote me
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Best program for SQL database manipulation Rhadamanthys Database & Database Programming 3 07-02-2007 02:32 PM
How do I Program another Program? ! bosco General Programming 1 06-15-2007 11:15 AM
Need help w/ word count program (ASAP) siren C and C++ 1 04-23-2007 08:14 AM
How to modify a program written in .NET 2.0? jackyjack C# Programming 7 03-27-2007 12:26 PM


All times are GMT -5. The time now is 03:43 AM.

Contest Stats

Xav ........ 1024.41
MeTh0Dz|Reb0rn ........ 974.08
morefood2001 ........ 850.04
John ........ 841.93
WingedPanther ........ 661.52
marwex89 ........ 575.59
Brandon W ........ 456.18
chili5 ........ 292.12
orjan ........ 187.41
Steve.L ........ 181.88

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 79%

Ads