0% found this document useful (0 votes)
3 views

task 9

The document contains a C# program that prompts the user to input two numbers and performs addition using a static method from a 'product' class. The 'product' class also includes methods to display product information and set new values for product ID and price. The program is structured within a namespace called 'lab 9'.

Uploaded by

Syed M Ali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

task 9

The document contains a C# program that prompts the user to input two numbers and performs addition using a static method from a 'product' class. The 'product' class also includes methods to display product information and set new values for product ID and price. The program is structured within a namespace called 'lab 9'.

Uploaded by

Syed M Ali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Main

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace lab 9
{
class Program
{
static void Main(string[] args)
{

int a, b;
Console.WriteLine( "Enter no 1");
a =int.Parse(Console.ReadLine());
Console.WriteLine("Enter no 2");
b = int.Parse(Console.ReadLine());

Console.WriteLine(Calculate.Addition(a, b));

product.display(product._proid, product.price);

product.pset(product._proid, product.price);

//Console.WriteLine( );

Console.ReadKey();

Class

namespace lab 9
{
public static class product
{
static public string _proid="23";
static public string price="500";

public static string display(string a,string b)


{
return a + b;
}

public static string pset(string a, string b)


{
a = "10";
b = "156.32";
return a + b;
}
}
}

You might also like