Skip to content

Instantly share code, notes, and snippets.

@SajjadArifGul
Created October 4, 2015 08:14
Show Gist options
  • Save SajjadArifGul/3e18759808cf50631202 to your computer and use it in GitHub Desktop.
Save SajjadArifGul/3e18759808cf50631202 to your computer and use it in GitHub Desktop.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace student
{
class Computer
{
public string ComName;
public string Model;
public string system;
public string hd;
public string processor;
public string usage;
public string battery;
public string windows;
public double price;
public bool rep;
static void Main(string[] args)
{
Computer C = new Computer();
C.get_data();
C.display();
C.repeat();
}
public void get_data()
{
Console.WriteLine("Kindly enter your laptop company name?");
ComName = Console.ReadLine();
Console.WriteLine("Kindly enter your Model Name?");
Model = Console.ReadLine();
Console.WriteLine("Kindly enter your System?");
system = Console.ReadLine();
Console.WriteLine("How Much Hard Disk??");
hd = Console.ReadLine();
Console.WriteLine("How much Processor?");
processor = Console.ReadLine();
Console.WriteLine("How much it is used?");
usage = Console.ReadLine();
Console.WriteLine("How much Battery Timing?");
battery = Console.ReadLine();
Console.WriteLine("Which Window?");
windows = Console.ReadLine();
Console.WriteLine("How much Price?");
price = Convert.ToDouble(Console.ReadLine());
}
public void display()
{
Console.WriteLine("Company Name :\t{0}", ComName);
Console.WriteLine("Model :\t{0}", Model);
Console.WriteLine("Hard Disk :\t{0}", hd);
Console.WriteLine("Hard Disk :\t{0}", hd);
Console.WriteLine("Processor :\t{0}", processor);
Console.WriteLine("Used :\t{0}", usage);
Console.WriteLine("Battery Timing :\t{0}", battery);
Console.WriteLine("Windows :\t{0}", windows);
Console.WriteLine("Price :\t{0}", price);
}
public void repeat()
{
Console.WriteLine("\n\tDo you want to update status?\n\n");
rep = Convert.ToBoolean(Console.ReadLine());
if (rep == true)
{
get_data();
display();
repeat();
}
if (rep == false)
{
Console.WriteLine("Thanks Sire .. Your Configuration is loaded on the Web");
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment