1. Given: List1[‘Bob’, ‘Andy’, ‘Roy’, ‘Mike’, ‘Kim’]
print the first element
Write a program in Java to display a diamond pattern of asterisks.
Expected Output :
*
***
*****
*******
*********
***********
*************
***********
*********
*******
*****
***
*
Write an application that plays "guess the number" as follows: Your program chooses the number to be guessed by selecting a random integer in the range 1 to 1000. The application displays the prompt Guess a number between 1 and 1000. The player inputs a first guess. If the player's guess is incorrect, your program should display Too high. Try again. or Too low. Try again. To help the player "zero in" on the correct answer, the program should prompt the user for the next guess. When the user enters the correct answer, display Congratulations. You guessed the number!, and allow the user to choose whether to play again.
Also, count the number of guesses the player makes. If the number is 10 or fewer, display Either you know the secret or you got lucky! If the player guesses the number in 10 tries, display Aha! You know the secret! If the player makes more than 10 guesses, display You should be able to do better!
Would you know how a gymnastics competition is scored? Well, for each performance, each judge gives a score in the range 1 to 10. Then, the highest and the lowest scores are canceled, and the rest are averaged. The average is the score of the performance.
For example, suppose there were 7 judges, and the performance gets the following scores.
9.20
9.00
8.75
9.40
9.60
8.90
9.60
The average would be 9.22 (that's (9.2+9.0+9.4+9.6+8.9)/ 5).
Write a python program that read 7 scores as input and outputs the average. The program should us an array of floats. Note that you need to determine the highest and the lowest score and exclude them in the computation.
Below is a sample output of this exercise.
Enter 7 scores: 9.20
9.00
8.75
9.40
9.60
8.90
9.60
High Score: 9.60
Low Score: 8.75
Average Score : 9.22
1, Develop an algorithm to calculate the sum of 5 numbers.
2, Develop an algorithm to find the largest number among the 3 numbers.
3, Develop an algorithm to calculate the average score of 50 student.
Write a program which takes a 9-digit number input from user, converts it into its reverse
and then display one of the following statements
What is the syntax for a multi dimensional array and a two dimensional array ?
Describe and illustrate the characteristics of an object ?
How to find input as operation
Explain:
It is subtraction operator given two numbers -150 - -100
Input:
-150 - -100
Output:
50
Input:
150 + 50
Output:
250
Lowest and Highest score
The teacher gave out the scores of the science quiz conducted last week and asked the ones with the lowest and highest scores to group up. Print the names of the students with minimum and maximum scores, respectively.
Note: In case of a tie, choose the name which comes first in the (dictionary order).
Sample Input1
2
shakti 24
disha 26
Sample Output1
shakti disha
Sample Input2
3
ajay 23
bijay 24
sanjay 23
Sample Output2
ajay bijay