C# Programming Logbook and Code

Verified

Added on  2019/09/20

|48
|4172
|365
Practical Assignment
AI Summary
This document presents a comprehensive logbook of C# programming exercises, covering topics such as statements and methods, objects and classes, sessions and collections, and inheritance. It includes detailed code snippets for various tasks, such as temperature and unit conversions, creating and manipulating objects, managing sessions, and implementing inheritance. The logbook also features screenshots of the application's output, demonstrating the functionality of the code. The exercises are designed to provide hands-on experience with C# programming concepts and techniques, making it a valuable resource for students learning C#.
Document Page
Logbook
Element 1
Lab: Statements and Methods
Part C- Play with Methods
In
pu
t
Te
m
pe
rat
ur
e
30
From
Fahre
nheit
Celsiu
s = -
1.11
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
In
p
ut
T
e
m
p
er
at
ur
From
Celsius
to
Fahren
heit =
86
Document Page
From[
ft] to
Meter
[m]
12.9
Input
your
Value
40
Document Page
Input
your
Value
50
From
Meter[m
] to
Foot] [ft]
164.05
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Input
your
Value
50
From
Pounds
[Lbs] to
Kilogra
ms [kg]
226.8
Document Page
Input
your
Value
100
From
Kilograms
[kg] to
Pounds
[Lbs]
220.46
Document Page
Input
your
Value
1000
From
Kg to
Tone
s
1
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Coding
Form1.cs
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void groupBox1_Enter(object sender, EventArgs e)
{
}
private void radioButton1_CheckedChanged(object sender, EventArgs e)
{
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
double number;
number = double.Parse(textBox1.Text);
if (radioButton1.Checked == true)
{
number = (number - 32) * 5 / 9;
}
else if (radioButton2.Checked == true)
{
number = (number * 9) / 5 + 32;
}
else if (radioButton3.Checked == true)
{
number = number / 3.2808;
}
else if (radioButton4.Checked == true)
{
number = number * 3.2808;
}
else if (radioButton5.Checked == true)
{
number = number / 2.2046;
}
else if (radioButton6.Checked == true)
{
number = number * 2.2046;
}
else if (radioButton7.Checked == true)
{
number = number / 1000;
Document Page
}
number = Math.Round(number, 2);
label3.Text = number.ToString();
}
private void Form1_Load(object sender, EventArgs e)
{
}
}
}
Document Page
Element 2
Lab: Objects and Classes
Exercise 2-HelloDogs 4
textboxes
has been
created
and
variables
are
changed
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Coding
Dog.cs
New
Breed
has
been
update
d
Document Page
namespace HelloDogs
{
class Dog
{
private string barkSound;
private string breed;
private int dogHeight;
private string dogColour;
private static int noOfLegs = 4;
public string Breed
{
get { return breed; }
set { breed = value; }
}
public int DogHeight
{
get
{
return dogHeight;
}
set
{
dogHeight = value;
}
}
public string DogColour
{
get
{
return dogColour;
}
set
{
dogColour = value;
}
}
public static int NoOfLegs
{
get
{
return noOfLegs;
}
set
{
noOfLegs = value;
}
}
private string dogSpeech;
public Dog()
{
barkSound = "Woof!";
breed = "cocker spaniel";
Ad
din
g
ne
w
Co
nst
ruc
tor
Ad
din
g 3
Pri
vat
e
Var
iab
les
chevron_up_icon
1 out of 48
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]