4 Replies - 716 Views - Last Post: 07 April 2010 - 09:15 PM Rate Topic: -----

#1 Guest_Chepab04*


Reputation:

Using Functions

Posted 07 April 2010 - 05:09 PM

can anyone guide me thru this program please how can i start this im new with C#


2. Write a program that asks the user to enter two numbers, obtains the two numbers from the user and displays the sum, product, difference and quotient of the two numbers. Make a function for each of the operations sum, produce, difference and quotient.


this is what i have so far just the starting part

using System;

public class Two
{
    public static void Main(string[] args)
    {

    }
}



Admin Edit: Please use code tags when posting your code. Code tags are used like so => :code:

Thanks,
PsychoCoder :)

Is This A Good Question/Topic? 0

Replies To: Using Functions

#2 s3thst4   User is offline

  • a * a = (b * b) + (c * c) - 2(b)(c)cos(A)
  • member icon

Reputation: 10
  • View blog
  • Posts: 587
  • Joined: 20-November 08

Re: Using Functions

Posted 07 April 2010 - 05:16 PM

You didn't even attempt it. No one will help if you don't try.
Was This Post Helpful? 0
  • +
  • -

#3 JackOfAllTrades   User is offline

  • Saucy!
  • member icon

Reputation: 6246
  • View blog
  • Posts: 24,014
  • Joined: 23-August 08

Re: Using Functions

Posted 07 April 2010 - 05:21 PM

Yeah, you're going to have to do better than that!

I'll give you a couple of hints: string data = Console.ReadLine(); reads a line from the user into the string variable data. Console.WriteLine(data) writes that same line of data out to the screen.

Now open up the books and get crackin'.
Was This Post Helpful? 0
  • +
  • -

#4 Guest_chepab04*


Reputation:

Re: Using Functions

Posted 07 April 2010 - 08:43 PM

View PostJackOfAllTrades, on 07 April 2010 - 04:21 PM, said:

Yeah, you're going to have to do better than that!

I'll give you a couple of hints: string data = Console.ReadLine(); reads a line from the user into the string variable data. Console.WriteLine(data) writes that same line of data out to the screen.

Now open up the books and get crackin'.




i don't got a book our teacher just decided to give us this program im in highschool its like a extra credit program
Was This Post Helpful? 0

#5 PsychoCoder   User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1659
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: Using Functions

Posted 07 April 2010 - 09:15 PM

Well I think it's horrible that a teacher would give an assignment then not offer any help, but that doesnt change our site policy. If you don't show an effort (which means more than what Visual Studio gives when you just create a project) then no code will be given.

Here's a Gettin started with C# tutorial that will show you how to get the input from the user in a Console application (which looks like what you're creating)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1