i am a java beginner can u help me with a couple of questions plz and if u know any websites to improve my jav?

1.      The company pays “straight time” for the first 40 hours worked by each employee and pays “time-and-a-half” for all hours worked in excess of 40 hours. You’re given a list of the employees of the company, the number of hours each employee worked last week and the hourly rate of each employee. Your program should input this information for each employee, and should determine and display the employee's gross pay. This program should allow the user to enter the information of many employees until he/she enters -1.

 

Sample run:

Enter the number of hours worked (-1 to end): 39

Enter hourly rate of the worker: 10

Salary is $390

 

Enter the number of hours worked (-1 to end): 40

Enter hourly rate of the worker: 10

Salary is $400

 

Enter the number of hours worked (-1 to end): 41

Enter hourly rate of the worker: 10

Salary is $415.00

 

Enter the number of hours worked (-1 to end): -1




2. Write a program that reads a series of integers; a positive followed by a negative then by a positive and so on. Once the user enters two successive positive or negatives numbers, the program should stop reading integers and displays the highest and lowest integers entered. (assume the first integer should be positive)

Sample run:
Enter a series of integers (2 successive negative or 2 successive positive to stop):

56
-896
74
-12
9
-85
319
-202
9584
-5
-96

The lowest integer is: -896
The highest integer is: 9584




3. A number n is called deficient if the sum of its proper divisors is less than n. 8 is a deficient number because the sum of divisors of 8: 1+2+4=7. Write a program that finds all the deficient numbers which are less than or equal 100, display 10 per line.
Sample Run:
Deficient numbers less than or equal 100:
2 3 4 5 7 8 9 10 11 13
14 15 16 17 19 21 22 23 25 26
27 29 31 32 33 34 35 37 38 39
41 43 44 45 46 47 49 50 51 52
53 55 57 58 59 61 62 63 64 65
67 68 69 71 73 74 75 76 77 79
81 82 83 85 86 87 89 91 92 93
94 95 97 98 99


4. Write a program that keeps prompting the user to enter a character different than a digit. The first digit entered by the user stops the input and the program should then display the number of punctuations characters entered (one of this list ! . , ; ?). When none is found, display a message “Characters entered without punctuation”.

Sample run1:
Enter any character (a digit 0-9 to stop): a B , R x u ! @ . C W 2
The list you entered contains 3 punctuations signs.
Sample run2:
Enter any character (a digit 0-9 to stop): r T 0
No punctuation.






5. Write a program that prompts the user to enter two digits (d1 and d2) between 1 and 9. Your program should then generate an integer (n) starting with the smallest digit between d1 and d2 and containing all digits in between till reaching the maximum among them two.

Hint: if the integers d1 and d2 are 5 and 2, 2 is min and 5 is max, the integer n can be generated as follow: 2-->2 * 10 -->20 + 3 = 23-->23*10-->230+4-->234*10-->2340+5-->2345

Sample run1:
Enter first digit between 1 and 9: 5
Enter second digit between 1 and 9: 2
Integer generated is 2345

Sample run2:
Enter first digit: 4
Enter second digit: 9
Integer generated is 456789
 


sort by: active | newest | oldest

https://www.youtube.com/user/thenewboston

check out this youtube channel

Try this site: http://www.homeandlearn.co.uk/java/java.html
Or if you are using eclipse, you can try these videos: http://sourceforge.net/projects/eclipsetutorial/files/1.%20Total%20Beginners/Version%201.0/
My students are cheating from internet, I know you.
LIU Instructor
gougi88 (author) 4 years ago
the teacher wants us to use (for while and do/while structure)
verence4 years ago
Homework?
gougi88 (author)  verence4 years ago
yup
i am having a hard time solving it
thanks