Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

Create a Java program in jdoodle that will determine if the score is Passed/Failed. (10 is the passing score out of 20)

  • Will not accept special characters.
  • will not accept blank score.
  • will not accept if it's greater than 20.
  • will not accept if it's lesser than 1.

Instructions:



An array containing 10 predefined double values are already provided for you in the code editor. Print each of the element out in separate lines, starting from the last array element down to the first.


Each outputted value must also only show up to two decimal places.



Output



Multiple lines containing a float number.



5.10


5.50


4.00


4.02


3.00


3.66


2.50


2.20


1.21

a) Write a method GetOneStudent that asks a student for both of his/her WRAV101 and

WRSC111 marks (each as a real number). The method must return both of these marks. The

method must ensure that each of the marks is in the range 0 to 100.

b) Write a method CanContinue that takes as input two marks, one for WRAV101 and one for

WRSC111. Each of these marks is in the range 0 to 100. The method must return the value

true if both of these marks are at least 50, otherwise the method must return the value false.

c) Write a method DisplayDecision that takes as input two marks, one for WRAV101 and one

for WRSC111. Each of these marks is in the range 0 to 100. If the student can continue with

the second semester modules (use CanContinue above), an appropriate message and the

average mark for the two modules is displayed, otherwise the student is informed that he may


Jack `N Poy


The winner is selected depending on the following rules:

  • Rock beats Scissors
  • Scissors beats Paper
  • Paper beats Rock
  • If both players chose the same option, then it's a tie

Instructions:

  1. In the code editor, you are provided with an enum called option which contains three possible named values:
  2. ROCK - 'r'
  3. PAPER - 'p'
  4. SCISSORS - 's'
  5. Your task is to ask two users for there chosen options. And then based on their options, determine the winner.

Input


1. Option selected by Player 1

2. Option selected by Player 2

Output

If Player 1 wins, print the message "Player 1 wins!"

If Player 2 wins, print the message "Player 2 wins!"

If it's a tie, print the message "It's a tie!"

Player·1:·r
Player·2:·p
Player·2·wins!




Write a two class application that has as a data member an array that can store state



area codes. The class should have a member method that enables users to test an



area code to determine if the number is one of the area codes in the state exchange.



The member method should use one of the predefined methods of the Array



class and return true if the argument to the method is one of the state codes.



Override the ToString( ) method to return the full list of area codes with each



surrounded by parentheses. To test the class, store a list of state codes in a onedimensional array. Send that array as an argument to the class. Your application



should work with both an ordered list of area codes or an unordered list

Dealing With Months

by CodeChum Admin

We're done dealing with days. It's time to step up and now deal with months!


Instructions:

  1. In the code editor, you are provided with a code in the main() which has 12 cout's. Each cout prints a month with its corresponding value. For this program, January is 1, February is 2, March is 3, and so on. When you run the initial code, you will encounter errors because these month names that have been printed don't exist yet.
  2. Your task is to create an enum data type which contains these month names as values so that when we run the code, there will be no more error.
  3. Do not edit anything in the main().

Output


January·=·1
February·=·2
March·=·3
April·=·4
May·=·5
June·=·6
July·=·7
August·=·8
September·=·9
October·=·10
November·=·11
December·=·12

Create three arrays of type double. Do a compile-time initialization and place




different values in two of the arrays. Write a program to store the product of the




two arrays in the third array. Produce a display using the MessageBox class




that shows the contents of all three arrays using a single line for an element from




all three arrays. For an added challenge, design your solution so that the two




original arrays have a different number of elements. Use 1 as the multiplier when




you produce the third array.

Using Pointer


The students’ IDs and test answers are


stored in a file. The first entry in the file contains answers to the test in the form:


TFFTFFTTTTFFTFTFTFTT


Every other entry in the file is the student ID, followed by a blank, fol- lowed by the student’s responses. For example,


the entry:


ABC54301 TFTFTFTT TFTFTFFTTFT


indicates that the student ID is ABC54301 and the answer to question 1 is True, the answer to question 2 is False, and


so on. The exam has 20 questions, and the class has more than 150 students.


Each correct answer is awarded two points, each wrong answer gets one point deducted, and no answer gets zero


points.


Write a program that processes the test data. The output should be the student’s ID, followed by the answers, followed


by the test score, followed by the test grade. Assume the following grade scale: 90%–100%, A; 80%–89.99%, B; 70%–


79.99%, C; 60%–69.99%, D; and 0%–59.99%, F.

Use Pointer


Write a program that allows the user to enter the last names of a number of candidates in a local election and the


number of votes received by each candidate. The program should then output each candidate’s name, the number of


votes received, and the percentage of the total votes received by the candidate. Your program should also output the


winner of the election. A sample output is:



Number of Candidates: 5


Candidate Votes recieve %of total vote


Johnson 5000 25.91



Miller 4000 20.73



Duffy 6000 31.09



Robinson 2500 12.95



Ashtony 1800 9.33



Total 19300




The winner of the election is Duffy!!



Toll roads have different fees at different times of the day and on weekends. Write a function CalcToll() that has three arguments: the current hour of time (int), whether the time is morning (bool), and whether the day is a weekend (bool). The function returns the correct toll fee (double), based on the chart below.

Weekday Tolls

  • Before 7:00 am ($1.15)
  • 7:00 am to 9:59 am ($2.95)
  • 10:00 am to 2:59 pm ($1.90)
  • 3:00 pm to 7:59 pm ($3.95)
  • Starting 8:00 pm ($1.40)

Weekend Tolls

  • Before 7:00 am ($1.05)
  • 7:00 am to 7:59 pm ($2.15)
  • Starting 8:00 pm ($1.10)

Ex: The function calls below, with the given arguments, will return the following toll fees:

CalcToll(8, true, false) returns 2.95

CalcToll(1, false, false) returns 1.90

CalcToll(3, false, true) returns 2.15

CalcToll(5, true, true) returns 1.05


LATEST TUTORIALS
APPROVED BY CLIENTS