# Thread: Some exercises

1. Member
Join Date
Oct 2009
Posts
7
Rep Power
0

## Some exercises

Could you guys help me resolve the following exercises or some of them at least? I need them in order to succeed in a contest and get more into Java.

We are asked to solve them using Java.

Exercise1
Write a program that verifies the validity of a series of codes saved in the file
code.txt. This code has three parts: a number of count, a separator ".' and a
number of control. The cod"e is correct if:
-the remainder of the number of count divided by 97 is different from
zero and equal to the number of control.
-the remainder of the number of count divided by 97 is zero and the
number of control is 97. (
Example:
Code = 15742-28: 15742 modulo 97 = 28 correct
Code = 72270-5: 72270 modulo 97 = 5 correct
Code = 22610-10: 22610 modulo 97 = 9 incorrect
Code = 50537-0: 50537 modulo 97 = 0 incorrect
Code = 50537-97 : 50537 modulo 97 = 0 correct
Use the function/Method CODE_TEST with two input parameters (number of
count and number of control) from the file code.txt to display the message, if
the code is correct or incorrect.

Exercise2
Write a program that generates 100 random i'1teger vaiues. The program
counts the number of values that fall within one of 10 Categories (1..10,
11..20, 21..30, .., 91..100). The result is graphically displayed sideways on the
screen.
Example of a result:
CatOl: *******
Cat02: *********
CatO3: *****
CatO4:****************** .
CatO5:********************
CatO6:***********
CatO7:**********
CatO8:************
CatO9:******
CatlO:***

Exercise3 .
Write a program that read the 'lector T of dimension N = 50. Fill the vector .
from the keyboard. .
Order inverse the elements of the vector T without u sing anew vector and
output the result.
."

."
Exercise4
Write a program to find, in a matrix A, the elements that are at the same time
the maximum in their line and the minimum in their column. Display the values
and the positions of these elements.

Your help will be appreciated, thank you.

2. What do we win if we are tops in the contest?

3. Originally Posted by javaamateur
Could you guys help me resolve the following exercises or some of them at least? I need them in order to succeed in a contest and get more into Java.

We are asked to solve them using Java.

Exercise1
Write a program that verifies the validity of a series of codes saved in the file
code.txt. This code has three parts: a number of count, a separator ".' and a
number of control. The cod"e is correct if:
-the remainder of the number of count divided by 97 is different from
zero and equal to the number of control.
-the remainder of the number of count divided by 97 is zero and the
number of control is 97. (
Example:
Code = 15742-28: 15742 modulo 97 = 28 correct
Code = 72270-5: 72270 modulo 97 = 5 correct
Code = 22610-10: 22610 modulo 97 = 9 incorrect
Code = 50537-0: 50537 modulo 97 = 0 incorrect
Code = 50537-97 : 50537 modulo 97 = 0 correct
Use the function/Method CODE_TEST with two input parameters (number of
count and number of control) from the file code.txt to display the message, if
the code is correct or incorrect.

Exercise2
Write a program that generates 100 random i'1teger vaiues. The program
counts the number of values that fall within one of 10 Categories (1..10,
11..20, 21..30, .., 91..100). The result is graphically displayed sideways on the
screen.
Example of a result:
CatOl: *******
Cat02: *********
CatO3: *****
CatO4:****************** .
CatO5:********************
CatO6:***********
CatO7:**********
CatO8:************
CatO9:******
CatlO:***

Exercise3 .
Write a program that read the 'lector T of dimension N = 50. Fill the vector .
from the keyboard. .
Order inverse the elements of the vector T without u sing anew vector and
output the result.
."

."
Exercise4
Write a program to find, in a matrix A, the elements that are at the same time
the maximum in their line and the minimum in their column. Display the values
and the positions of these elements.

Your help will be appreciated, thank you.
All kidding aside, the least you can do here is show some effort, don't you think?

4. Member
Join Date
Oct 2009
Posts
7
Rep Power
0
:) you are right, I am actually trying, but I just need a push, at least with one of them resolved...

5. Well regardless, I wish you much luck.

6. Member
Join Date
Oct 2009
Posts
7
Rep Power
0
Thank you...this is for a job :)

7. ... this is for a job...
I'm not sure how to respond to that other than to say that I'd want my co-worker to be someone who shows knowledge, initiative, and honesty, someone who can do these problems without resorting to cheating. Otherwise I'm hosed.

Again, much luck!

8. Member
Join Date
Oct 2009
Posts
7
Rep Power
0
Originally Posted by Fubarable
I'm not sure how to respond to that other than to say that I'd want my co-worker to be someone who shows knowledge, initiative, and honesty, someone who can do these problems without resorting to cheating. Otherwise I'm hosed.

Again, much luck!
oh, no i am not actually cheating, these were given as samples to work on and practise, and i am actually working in parallel now in solving them, and doing my researches...i just needed a push as i said, at least in one complete exercise, because I have the logic, only few difficulties in syntaxes...still i am googling them and learning but since i dont have much time, I am working on different levels...:)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•