Beruflich Dokumente
Kultur Dokumente
MARINDUQUE STATE
COLLEGE BS Industrial Technology
SCHOOL OF TECHNOLOGY BS Information
Technology
P. Manguera Sr., Rd.
BS Information System
Tanza, Boac, Marinduque
General Directions: Read and answer the questions/statements properly. Write your answers on the box
provided. Save your file in Your_LastnameFirstname_Section.
((x < 10) && ( x > 5)) || ((x > 20) && (x <
25));
System.Convert.ToInt32("35");
VISION: “Marinduque State College is a research-driven higher education institution pursuing excellence and innovation by 2025.”
MISSION: “Marinduque State College is committed to pursue progressive and innovative lifelong education founded on humanistic, professional and technologically
advanced programs across cultures and communities by establishing centres’ of excellence and development and research-drivenRevision
outreach No:
programs.”
3
RevisedRevision
Date:No: 0
08/5/2018
Revised Date: 08/05/2018
Republic of the Philippines Courses Offered:
MARINDUQUE STATE
COLLEGE BS Industrial Technology
SCHOOL OF TECHNOLOGY BS Information
Technology
P. Manguera Sr., Rd.
BS Information System
Tanza, Boac, Marinduque
2. What methods are used for displaying text/output on screen which is considered are C# console output
statements? What are the differences between these methods?
Printing String using WriteLine()
Console.WriteLine("Prints on "); The main difference
Console.WriteLine("New line"); between WriteLine() and Write() is that
Output: the Write() method only prints the string provided
Prints on to it, while the WriteLine() method prints the string
New line and moves to the start of next line as well.
Printing String using Write()
Console.Write("Prints on ");
Console.Write("Same line");
Output:
Prints on Same line
3. What are the console input statements in C# which are used for capturing input from users? Discuss the
differences of each method.
Console.WriteLine() statement, Console.ReadLine() statement Console.ReadKey() statement
we display the message on the will read our input, but it is of is here just to keep our console
console window and move to the type string and what we need is window open.
next line. an int type.
So, we need to convert it with
the Convert. To
Int32() statement.
VISION: “Marinduque State College is a research-driven higher education institution pursuing excellence and innovation by 2025.”
MISSION: “Marinduque State College is committed to pursue progressive and innovative lifelong education founded on humanistic, professional and technologically
advanced programs across cultures and communities by establishing centres’ of excellence and development and research-drivenRevision
outreach No:
programs.”
3
RevisedRevision
Date:No: 0
08/5/2018
Revised Date: 08/05/2018
Republic of the Philippines Courses Offered:
MARINDUQUE STATE
COLLEGE BS Industrial Technology
SCHOOL OF TECHNOLOGY BS Information
Technology
P. Manguera Sr., Rd.
BS Information System
Tanza, Boac, Marinduque
C# has a total of 79 keywords. All these keywords are in lowercase. Here is a complete list of all C#
keywords.
abstract as base bool
in (generic
in int interface
modifier)
out (generic
operator out override
modifier)
VISION: “Marinduque State College is a research-driven higher education institution pursuing excellence and innovation by 2025.”
MISSION: “Marinduque State College is committed to pursue progressive and innovative lifelong education founded on humanistic, professional and technologically
advanced programs across cultures and communities by establishing centres’ of excellence and development and research-drivenRevision
outreach No:
programs.”
3
RevisedRevision
Date:No: 0
08/5/2018
Revised Date: 08/05/2018
Republic of the Philippines Courses Offered:
MARINDUQUE STATE
COLLEGE BS Industrial Technology
SCHOOL OF TECHNOLOGY BS Information
Technology
P. Manguera Sr., Rd.
BS Information System
Tanza, Boac, Marinduque
VISION: “Marinduque State College is a research-driven higher education institution pursuing excellence and innovation by 2025.”
MISSION: “Marinduque State College is committed to pursue progressive and innovative lifelong education founded on humanistic, professional and technologically
advanced programs across cultures and communities by establishing centres’ of excellence and development and research-drivenRevision
outreach No:
programs.”
3
RevisedRevision
Date:No: 0
08/5/2018
Revised Date: 08/05/2018
Republic of the Philippines Courses Offered:
MARINDUQUE STATE
COLLEGE BS Industrial Technology
SCHOOL OF TECHNOLOGY BS Information
Technology
P. Manguera Sr., Rd.
BS Information System
Tanza, Boac, Marinduque
8. What are the two kinds of C# type conversion? Provide programming example.
Type Conversion Description Example Conversion
Implicit type conversion These conversions are performed // Implicit conversion. A
by C# in a type-safe manner. For long can
example, are conversions from // hold any value an int can
VISION: “Marinduque State College is a research-driven higher education institution pursuing excellence and innovation by 2025.”
MISSION: “Marinduque State College is committed to pursue progressive and innovative lifelong education founded on humanistic, professional and technologically
advanced programs across cultures and communities by establishing centres’ of excellence and development and research-drivenRevision
outreach No:
programs.”
3
RevisedRevision
Date:No: 0
08/5/2018
Revised Date: 08/05/2018
Republic of the Philippines Courses Offered:
MARINDUQUE STATE
COLLEGE BS Industrial Technology
SCHOOL OF TECHNOLOGY BS Information
Technology
P. Manguera Sr., Rd.
BS Information System
Tanza, Boac, Marinduque
namespace TypeConversionApplication {
class StringConversion {
static void Main(string[] args) {
int i = 75;
float f = 53.005f;
double d = 2345.7652;
bool b = true;
Console.WriteLine(i.ToString());
Console.WriteLine(f.ToString());
Console.WriteLine(d.ToString());
Console.WriteLine(b.ToString());
Console.ReadKey();
}
}
}
Output:
75
53.005
2345.7652
True
VISION: “Marinduque State College is a research-driven higher education institution pursuing excellence and innovation by 2025.”
MISSION: “Marinduque State College is committed to pursue progressive and innovative lifelong education founded on humanistic, professional and technologically
advanced programs across cultures and communities by establishing centres’ of excellence and development and research-drivenRevision
outreach No:
programs.”
3
RevisedRevision
Date:No: 0
08/5/2018
Revised Date: 08/05/2018
Republic of the Philippines Courses Offered:
MARINDUQUE STATE
COLLEGE BS Industrial Technology
SCHOOL OF TECHNOLOGY BS Information
Technology
P. Manguera Sr., Rd.
BS Information System
Tanza, Boac, Marinduque
Prepared By:
VISION: “Marinduque State College is a research-driven higher education institution pursuing excellence and innovation by 2025.”
MISSION: “Marinduque State College is committed to pursue progressive and innovative lifelong education founded on humanistic, professional and technologically
advanced programs across cultures and communities by establishing centres’ of excellence and development and research-drivenRevision
outreach No:
programs.”
3
RevisedRevision
Date:No: 0
08/5/2018
Revised Date: 08/05/2018