Académique Documents
Professionnel Documents
Culture Documents
47325
Problem 1:
1. Create program that will compute for the student’s final grade with the
following conditions:
a. Your program will ask for the students Prelim, Midterm, Pre-final, Final
and Class Standing grades.
b. Prelim grade (17.5%), Midterm (20%), Pre-final (17.5%), Finals (30%),
CS (15%)
c. Your program will determine if the Final Grade passed/failed the
subject. Passing grade should be 75 or above.
Sample Output:
Prelim:82
Midterm:75
Pre-Final:70
Finals:74
CS:80
Final Grade:76
You Passed!
Codes:
using System;
Codes:
using System;
int dr;
Console.Write("Enter Direction in Degrees: ");
dr=Convert.ToInt32(Console.ReadLine());
Console.WriteLine(dr);
string drString = "";
if(dr==0 && dr==360){
drString="East";
}else if(dr>270){
drString="South East";
}else if(dr==270){
drString="South";
}else if(dr>180){
drString="South West";
}else if(dr==180){
drString="West";
}else if(dr>90){
drString="North West";
}else if(dr==90){
drString="North";
}else if(dr>0){
drString="North East";
}else{
Console.WriteLine("Invalid!!!");
}
}
}
Problem 3. Create a program that will ask for the user’s birthdate. Then print
user’s age in number of years, months and days passed his/her birthdate.
Sample Output:
Input Birthday
Month:January
Date:5
Year:2000
Codes:
using System;
if(dtot<0){
dtot2=dtot+31;
}
if(mi>=mo){
ytot=(yr-yi)-1;
Console.WriteLine("You are now {0} years {1} months and {2}
days old", ytot,mtot,dtot2);
}else{
ytot=yr-yi;
Console.WriteLine("You are now {0} years {1} months and {2} days
old", ytot,abs,dtot);
}
}