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

6.4.

Write a simple encryption program using string functions which apply the substitution method. Here is the given Substitution Table.

Substitution Table:

A *

E $

I /

O +

U -­‐

Sample input/output dialogue:

Enter message: meet me at 9:00 a.m. in the park

Encrypted message: m$$t m$ *t 9:00 *.m. /n th$ p*rk



 

1 The first method to be called should ask a salesperson for the dollar value of daily sales and return the entered value to the Main() method. 


2 The second method to be called should calculate the salesperson’s commission based on the rates in the following table. 

Sales 

Commission 

$0 to $999 

3% 

$1000 to $2999 

4% 

$3000 and up 

5% 



 5. “OptionB” Method 

Create a method called “OptionB” that will print the conversion from miles to kilometres by calling “MilesToKilometers” method (defined in the item #6 below) starting at 10 miles up to 100 miles in increments of 10. Show the result on a table in the console. 

6. “MilesToKilometers” Method 

Create a method called “MilesToKilometers” 

  • Name: MilesToKilometers 
  • • Parameter: o A double representing the miles distance 
  • o A double representing the kilometers distance - this should be an "out" parameter 
  • Returns: Nothing 
  • Displays: Nothing 
  • Task: Calculates the conversion from miles to kilometers. The converted kilometer is returned as an "out" parameter 

Task 4 

Write a program that does the following for 15 

students:

 Reads in 3 marks for each student (you 

need to ensure that only valid marks 

between 0 and 100 are processed) – your 

prompt message to the user should 

indicate which number is being requested 

(see example image of output)

 Calculates and displays the highest mark 

for each student.

Finds and displays the highest mark in the class.


Which of the following is not keyword in java ?

Select one:

a. import

b. package

c. volatile

d. null


What is the output of this program?

  1.     class Output {
  2.         public static void main(String args[])
  3.         {   
  4.              int a = 1;
  5.              int b = 2;
  6.              int c;
  7.              int d;
  8.              c = ++b;
  9.              d = a++;
  10.        c++;
  11.        b++;
  12.        ++a;
  13.        System.out.println(a + " " + b + " " + c);
  14.      }  

Select one:

a. 2 3 4

b. 3 2 4

c. 3 4 4

d. 3 2 3


What is the output of the following program

class TestApp {

public static void main(String[] args) {

for (int index = 0; 1; index++) {

System.out.println("Welcome");

break;

}

}

}


Select one:

A. Welcome

B. Type mismatch error

C. Run infinite-times

D. Welcome Welcome



3.“OptionA” Method 

Create a method called “OptionA” that will print the conversion from pounds to kilograms by calling “PoundsToKilograms” method (defined in the item #4 below) starting at 200 pounds down to 50 pounds in decrements of 5. Show the result on a table in the console. 

4. “PoundsToKilograms” Method 

Create a method called “PoundsToKilograms” 

  • Name: PoundsToKilograms 
  • Parameter: A double representing the pounds 
  • Returns: A double representing the kilograms converted from pounds parameter 
  • Displays: Nothing 
  • Task: Calculates the conversion from pounds to kilograms. The converted kilogram is the returned value from the method. 


 Create a method called “OptionA” that will print the conversion from pounds to kilograms by calling “PoundsToKilograms” method (defined in the item #4 below) starting at 200 pounds down to 50 pounds in decrements of 5. Show the result on a table in the console. 


Write a program which requests a number between 1 and 50 from the user. It must repeatedly ask the user for a number until a valid number is entered. After receiving a valid number, the program must display all the even numbers smaller than that number.

LATEST TUTORIALS
APPROVED BY CLIENTS