Benedict Castro

Greenhorn

Posts: 1

posted 1 year ago

Help me on this Java Problems.

1.) Write a program that would determine if the string inputted by the user is a valid code or not.

Here are the scenarios for you to be a valid code:

1. a code should have a maximum length of 5.

2. a code should start with a letter.

3. a code could contain a digit.

4. a code should end with an asterisk(*).

Ex. input: aj#kj

invalid code

input: a23k*

valid code

2.) Write a complete program for the Aviation Model Competition Scoring System. The evaluation committee consists of 10 judges. Each competitor receives a score between 0 and 10 from all judges. The highest and the lowest scores are removed from the board,and the average of the remaining 8 scores determines the final score of the competitor.

The program will receive 10 scores and compute the final score of a competitor.

A sample run:

Please enter 10 scores:

9.5 8.7 9.9 9.0 7.6 7.9 8.5 9.3 6.5 9.8

The final score is: 8.79

3.) Make a program that would input 10 integers and output:

a. Their total

b. The largest

c. The smallest

d. The total of all positive numbers

e. The total of all negative numbers

f. How many negative numbers were entered

g. How many numbers between 50 and 100 were entered

1.) Write a program that would determine if the string inputted by the user is a valid code or not.

Here are the scenarios for you to be a valid code:

1. a code should have a maximum length of 5.

2. a code should start with a letter.

3. a code could contain a digit.

4. a code should end with an asterisk(*).

Ex. input: aj#kj

invalid code

input: a23k*

valid code

2.) Write a complete program for the Aviation Model Competition Scoring System. The evaluation committee consists of 10 judges. Each competitor receives a score between 0 and 10 from all judges. The highest and the lowest scores are removed from the board,and the average of the remaining 8 scores determines the final score of the competitor.

The program will receive 10 scores and compute the final score of a competitor.

A sample run:

Please enter 10 scores:

9.5 8.7 9.9 9.0 7.6 7.9 8.5 9.3 6.5 9.8

The final score is: 8.79

3.) Make a program that would input 10 integers and output:

a. Their total

b. The largest

c. The smallest

d. The total of all positive numbers

e. The total of all negative numbers

f. How many negative numbers were entered

g. How many numbers between 50 and 100 were entered

Campbell Ritchie

Marshal

Posts: 56529

172

posted 1 year ago

Welcome to the Ranch

We do not supply complete solutions, but are happy to have a look at what you have done. Please show us what you have achieved so far.

We do not supply complete solutions, but are happy to have a look at what you have done. Please show us what you have achieved so far.

Mike London

Ranch Hand

Posts: 1505

11

posted 1 year ago

If you're having problems with these examples, I would recommend you take some Java tutorials or read a few intro Java blogs, articles, books, or whatever.

None of these problems is difficult.

The basic idea to understand in creating a solution for any but the most trivial code is step-wise refinement (or divide and conquer) of the problem space.

Good luck and learning Java is fun (and it never stops, for any of us!).

- mike

None of these problems is difficult.

The basic idea to understand in creating a solution for any but the most trivial code is step-wise refinement (or divide and conquer) of the problem space.

Good luck and learning Java is fun (and it never stops, for any of us!).

- mike

Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |