C# Answers

Questions answered by Experts: 1 362

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

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



not continue.



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.


create a console application to test usage of switch case construct. Accept some integer from user as command line argument and using a switch case construct

Make a program that will accept an integer and loop for the same number of times as that of the inputted integer and input random integers and add it to the array/list one by one, per line. Afterwards, make your program accept another random integer.

Using that final integer, compare from your array/list if the final integer's value is also present in your current array/list. If so, print "Present"; otherwise, print "None".

 

Start coding now!

Input

The first line contains the size of the array/list.

The next lines contain the integers.

The last line contains an integer to be searched.

5

3

21

2

5

23

2

Output

A line containing a string.

Present


If the monthly home loan repayment is more than a third of the user’s gross monthly


income, the software shall alert the user that approval of the home loan is unlikely.


7. The software shall calculate the available monthly money after all the specified deductions


have been made.


8. The software shall not persist the user data between runs. The data shall only be stored in


memory while the software is running.


Non-functional requirements:


1. You are required to use internationally acceptable coding standards. Include


comprehensive comments explaining variable names, methods, and the logic of


programming code.


2. You are required to use classes and inheritance. Create an abstract class Expense, from


which HomeLoan, etc., can be derived.


3. Store the expenses in an array

The first line will contain a message prompt to width of the skyscraper.


The second line will contain a message prompt to height of the skyscraper.


The succeeding lines will contain the skyscraper pattern.



Enter·width·of·skyscraper:·5


Enter·height·of·skyscraper:·10


···*


·*****


·*****


·*****


·*****


·*****


·*****


·*****


·*****


*******

How do you display an error message written like this: (“101 is not a valid mark, enter a number between 0 and 100”) in this code?


1. Write a program to declare a structure and inside it is a non-static method that returns the area of a rectangle.

 

Test Data and Sample Output:

Input the dimensions of a rectangle:

Length: 60

Width: 30

Expected Output:

Length: 60

Width: 30

Area: 1800



Write a user defined method named getMark that can be used to get a valid mark from the user. 

Your method must continuously ask the user for a mark, until a valid mark is entered (valid marks 

are between 0 and 100). If a user enters an invalid mark, display an error message before asking 

for a valid mark to be entered. The method must return the valid value to the calling program.

Write a user defined method named isPass that can be used to determine whether a mark is a 

pass mark (greater or equal to 50). The method must take as input a mark, and return a boolean, 

indicating whether the mark was a pass mark.

Write a program that reads in 5 marks by using the getMark method to ensure that valid marks are 

processed. You need to calculate the sum and the average of the marks. Your program must also 

use the isPass method to determine the number of pass marks entered. When the 5 marks have 

been processed you need to display the sum, average and number of passes (from these marks).


3.1 Write a function named "reverse” that takes as its arguments the following:

(a) an array of floating point values; (15)

(b) an integer that tells how many floating point values are in the array. (15)

The function must reverse the order of the values in the array.


Thus, for example, if the array that's passed to the function looks like this:

0 1 2 3 4

5.8 | 2.6 | 9.0 | 3.4 | 7.1


then when the function returns, the array will have been modified so that it looks like this:


0 1 2 3 4

7.1 | 3.4 | 9.0 | 2.6 | 5.8

The function should not return any value.


LATEST TUTORIALS
APPROVED BY CLIENTS