I am having a hard time with this can someone help please: Write a program that
ID: 3533603 • Letter: I
Question
I am having a hard time with this can someone help please:
Write a program that requests the numeric grades on a midterm and a final exam and then uses a Function procedure to assign a semester grade (A, B, C, D, OR F). The final exam should count twice as much as the midterm exam, the semester average should be rounded up to the nearest whole number, and the semester grade should be assigned by the folowing criteria: 90-100 (A), 80-89 (B), ... Use a function called Ceil that rounds noninteger numbers up to the nearest integer. The function Ceil can be defined by Ceil(x) = -int(-x). - in visual basic 2010
Explanation / Answer
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
int num ,count;
bool stat=false;
Console.WriteLine("Enter the number");
num = Convert.ToInt32(Console.ReadLine());
for (int i = 1; i <= num; i++)
{
count = 0;
for (int j = 1; j <= i; j++)
{
if ((i % j) == 0)
stat = true;
if (stat)
{
count++;
stat = false;
}
}
if(count==2)
Console.WriteLine(i);
}
Console.ReadLine();
}
}
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.