| Nov 06 - 11:12:49 |
|
| Post Reply | Post new topic | Page: 1  |
| C# is a bastard (any coders to help?) | Started by: Drexler on Mar 08, '11 16:41 |
|
Basically the simplest of C# jargon has gone right over my head, admittedly I am high far to often to learn but I do try :/ |
|
| Report Post | Tip |
|
Question 1
2.The input always consists of a number, followed by an operator, followed by another number.
3.The operators that are allowed are +, -, *, and /.
4.The solution must be implemented creating a class called Calculator.
5.The calculation should be performed by an instance method belonging to the class Calculator. This method should be called Calculate.
6.After performing a calculation, the method should prompt to the user a message asking if she wants to perform another calculation. If the answer is “YES”, then another calculation should be performed. If the answer is “NO”, then the application should be terminated. The system should reply to another answer indicating that the answer provided is not valid, and asking again if the user wants to perform another calculation.
7.The application Main method should create an instance of the class Calculator, and then trigger the calculation process appropriately.What happens if the user does not input the expect types of values? How can you check the validity of the input?
A possible algorithm for the solution of this problem could be:
1.Read the first number.
2.Read an operator.
3.Read the second number.
4.Check the operator, selecting the most appropriate conditional statement, in your opinion.
5.If the operator is '+', then calculate the summation of both number.
6.If the operator is '-', then calculate the subtraction of both number.
7.If the operator is '*', then calculate the multiplication of both number.
8.If the operator is '/', then calculate the division of both number.
9.Print out the result of calculation.
10.Ask the user if she wants to perform a new calculation.
11.Depending on the answer, ask again, start a new calculation or terminate the application “politely”.
|
|
| Reply by: Drexler at Mar 08, '11 16:43 | |
| Report Post | Tip |
|
Fucking fuck! why does this gay site paste shit twice :/ |
|
| Reply by: Drexler at Mar 08, '11 16:43 | |
| Report Post | Tip |
|
Question 2 |
|
| Reply by: Drexler at Mar 08, '11 16:45 | |
| Report Post | Tip |
|
Question 3 |
|
| Reply by: Drexler at Mar 08, '11 16:47 | |
| Report Post | Tip |
|
public class Teach |
|
| Reply by: KendrHo at Mar 08, '11 16:49 | |
| Report Post | Tip |
|
Le sigh! |
|
| Reply by: Drexler at Mar 08, '11 16:54 | |
| Report Post | Tip |
|
rofl. |
|
| Reply by: KendrHo at Mar 08, '11 16:55 | |
| Report Post | Tip |
|
:( |
|
| Reply by: Drexler at Mar 08, '11 16:56 | |
| Report Post | Tip |
|
Managed to do Task one after a day of failing. |
|
| Reply by: Drexler at Mar 09, '11 06:14 | |
| Report Post | Tip |
|
10 Print "Falure"
20 Goto 10
Run
Hope this helps |
|
| Reply by: EvilClown at Mar 09, '11 22:59 | |
| Report Post | Tip |
| Post Reply | View All Threads | Page: 1  |
Minimum $20,000