Posts

Showing posts from April, 2013

How to calculate result of subjects in C#

Image
How to calculate result of subjects in C#.png

Object 


Write a program that reads out marks sheet of a student. Take the marks of five subjects as input from the user and calculate the total marks, percentage and grade. Display the entire information on the console based on the following grade criteria. 
Total Marks Grade Greater than or equal to 90 but less than 100 A Less than 90 but greater than or equal to 80 B Less than 80 but greater than or equal to 70 C Less than 70 but greater than or equal to 60 D Less than 60 F





Code


using System; using System.Collections.Generic; using System.Linq; using System.Text;
namespace MarkSheet { classProgram

How to calculate area of a circle in c#

Image
How to calculate area of a circle in c#


Object


Write a program which takes radius of a circle and calculates the area in case the value entered by the user is non-zero positive integer. And it displays an error message otherwise.
Code
double area; int   radius; Console.WriteLine("\t\tFind The Area OF Circle\n"); Console.Write("Enter The Radius : ");                 radius = int.Parse(Console.ReadLine()); if (radius > 0)                 {                 area = 3.14 * radius * radius; Console.WriteLine("Area is  : " + area);             } else             { Console.WriteLine(".....error......");             }





How to make computer information program in c#

Image
How to make computer information program in c#

Object



Write a program that makes use of Console.ReadLine() and Console.WriteLine() to input the details of system configuration from a user and displays it on console.






Code


using System; using System.Collections.Generic; using System.Linq; using System.Text;
namespace simple { classProgram     { staticvoid Main(string[] args)         {

int hard_disk, ram, processor; Console.WriteLine("\t\twelcome to the system configration\n\n"); Console.Write("please insert a hard disk :");             hard_disk = Convert.ToInt32(Console.ReadLine()); Console.Write("please insert a ram :");             ram = Convert.ToInt32(Console.ReadLine()); Console.Write("plaease insert a processor:");             processor = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("\t your system configration "); Console.Write("hard disk is" + hard_disk); Console.WriteLine(""); Console.Write("ram is:" + ram); Con…

How to make simple mass calculator program in c#

Image
How to make simple mass calculator program in c#

Object
Write a program which takes a quantity mass as input and calculates Force applied on an object. (F=m*a)
Code
using System; using System.Collections.Generic; using System.Linq; using System.Text;
namespace simple { classProgram     { staticvoid Main(string[] args)         { int m,f; int a=5; Console.Write("Please Insert a Mass: ");             m = int.Parse(Console.ReadLine());             f = m * a; Console.WriteLine("Force is:  " + f);

        }












How to make fancy tool strip in c#

Image
How to make fancy tool strip in c#





















How to make slider in c#

Image
How to make slider in c#













 (Code inside the button that press before slider come )


Code
bool IsOpen = false; FormCollection fc = Application.OpenForms; foreach (Form f in fc)             { if (f.Name == "Fee Reg")                 {                     IsOpen = true;                     f.StartPosition = FormStartPosition.CenterParent;                     f.Focus(); break;

How to make grid view colorful in c#

Image
How to make grid view colorful in c#





Code
dataGridView1.EnableHeadersVisualStyles = false;             dataGridView1.ColumnHeadersDefaultCellStyle.BackColor = Color.Beige;             dataGridView1.RowHeadersDefaultCellStyle.BackColor = Color.Beige; for (int i = 0; i < dataGridView1.Rows.Count; i++)             { if (i % 2 != 0)                 {                     dataGridView1.Rows[i].DefaultCellStyle.BackColor = Color.Beige;                 }             }




Discount calculate program in c++

Image
Discount calculate program in c++



OBJECT

Write a c++ program that take prince and department code from user and tells the discount and sales price of code using switch statement


Algorithm


STEP#1Start STEP#2Declare the variables rp, sp, dc, discount STEP#3input price STEP#4input department code STEP#5switch dc STEP#6if case ‘310’ STEP#7Discount=(10*rp)/100 and sp=rp-discount STEP#8Display sale price and discounted price STEP#9if case ‘438’ STEP#10Discount=(12*rp)/100 and sp=rp-discount STEP#11Display sale price and discounted price STEP#12if case ‘284’ STEP#13Discount=(8*rp)/100 and sp=rp-discount STEP#14Display sale price and discounted price STEP#15if case ‘652’ STEP#16Discount=(15*rp)/100 and sp=rp-discount STEP#17Display sale price and discounted price STEP#18if default STEP#19Discount=(5*rp)/100 and sp=rp-discount STEP#20Display sale price and discounted price STEP#21End

CODING

#include <iostream> using namespace std; int main() {      int rp,sp,dc,discount;
     cout<<"Enter price = ";   …