• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Need Help in Java Problems.

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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


 
Marshal
Posts: 79178
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Bartender
Posts: 1971
17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
reply
    Bookmark Topic Watch Topic
  • New Topic