LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-09-2006, 06:23 PM   #1
pcharouz
LQ Newbie
 
Registered: Oct 2006
Posts: 8

Rep: Reputation: 0
Java homework help


Here is exactly what the teacher gave us(scanned)
http://img224.imageshack.us/my.php?i...an10001na4.jpg

here is what I did, I need help with everything else

Quote:
//Name: ********
//Date: 10/9/2006

import java.util.Scanner;

public class CountLetters{

public static void main(String[] args){

int a = 0;
int b = 0;
int c = 0;
int d = 0;
int e = 0;
int f = 0;
int g = 0;
int h = 0;
int i = 0;
int j = 0;
int k = 0;
int l = 0;
int m = 0;
int n = 0;
int o = 0;
int p = 0;
int q = 0;
int r = 0;
int s = 0;
int t = 0;
int u = 0;
int v = 0;
int w = 0;
int x = 0;
int y = 0;
int z = 0;




}

}

}

Last edited by pcharouz; 04-30-2007 at 05:20 PM.
 
Old 10-09-2006, 06:32 PM   #2
crazyjimbo
Member
 
Registered: Mar 2006
Location: Edinburgh
Distribution: Debian Etch, Gentoo
Posts: 90

Rep: Reputation: 16
Firstly, no one is going to do your homework for you! Secondly, be more specific about what you need help with.

If I were you, I would start by looking at the comments in the code. You have obvisouly created the 26 ints, so now move onto getting a string as input. Break it down into managable chunks - you are fortunate, the program has already been structured for you.
 
Old 10-09-2006, 07:00 PM   #3
pcharouz
LQ Newbie
 
Registered: Oct 2006
Posts: 8

Original Poster
Rep: Reputation: 0
I know nobody is going to do it for me, I am just totally confused on what am I supposed to do, and what is this thing supposed to do. Whe are doing if, else, and while now, so I am guessing it has something to do with that.
 
Old 10-09-2006, 08:19 PM   #4
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
As already stated use the comments to help you.

Read in a string (look at previous work that you have done)

Then once you have done that you want to loop through the string one character at a time, again your teacher has probably provided you with a similar example on how to achieve that.

The important thing about learning programming is not doing the whole problem, but learning to tackle it in small manageable chunks.
 
Old 10-09-2006, 09:55 PM   #5
Dan04
Member
 
Registered: Jun 2006
Location: Texas
Distribution: Ubuntu
Posts: 207

Rep: Reputation: 37
Have you learned about arrays yet?!
 
Old 10-10-2006, 06:25 AM   #6
pcharouz
LQ Newbie
 
Registered: Oct 2006
Posts: 8

Original Poster
Rep: Reputation: 0
Thanks
Quote:
Originally Posted by Dan04
Have you learned about arrays yet?!
no, but it was do today, so its already late.
 
Old 10-10-2006, 02:56 PM   #7
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

Three suggestions:
1. You definitely need to talk with your instructor.

We'd be happy to help when we can ... but this particular question was really too broad. Honestly.

2. Ask your instructor if tutoring is available.

Or - even better - see if any of your classmates might be interested in forming a study group together with you.

3. If you're serious about taking this course ... whether or not the teacher can spend any extra time with you, and whether or not tutoring is available ... then this book will DEFINITELY help you:

Head First Java, Kathy Sierra/Bert Bates
http://www.amazon.com/Head-First-Jav...dp/0596009208/

You absolutely owe it to yourself to get a copy!

'Hope that helps ... PSM
 
Old 10-10-2006, 05:11 PM   #8
pcharouz
LQ Newbie
 
Registered: Oct 2006
Posts: 8

Original Poster
Rep: Reputation: 0
I stayd there like 45 minutes after school today, and he explained it to me.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Homework pixellany LQ Suggestions & Feedback 14 06-30-2006 07:20 AM
homework help louce Linux - Newbie 3 09-04-2005 08:00 PM
please help my homework again donotexpert Programming 7 08-23-2005 10:26 AM
help me(my homework) please! donotexpert Programming 4 08-20-2005 06:26 AM
Need homework help! bumstickie Linux - Newbie 3 10-28-2002 04:37 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration