BabySid
BabySid
CC#
Created by BabySid on 10/6/2023 in #help
❔ I am facing a doubt in this question.
what you mean
25 replies
CC#
Created by BabySid on 10/6/2023 in #help
❔ I am facing a doubt in this question.
I dont understand
25 replies
CC#
Created by BabySid on 10/6/2023 in #help
❔ I am facing a doubt in this question.
what is it that I'm doin wrong
25 replies
CC#
Created by BabySid on 10/6/2023 in #help
❔ I am facing a doubt in this question.
No description
25 replies
CC#
Created by BabySid on 10/6/2023 in #help
❔ I am facing a doubt in this question.
but
25 replies
CC#
Created by BabySid on 10/6/2023 in #help
❔ I am facing a doubt in this question.
I should be getting these
25 replies
CC#
Created by BabySid on 10/6/2023 in #help
❔ I am facing a doubt in this question.
No description
25 replies
CC#
Created by BabySid on 10/6/2023 in #help
❔ I am facing a doubt in this question.
I dunno why that's happening
25 replies
CC#
Created by BabySid on 10/6/2023 in #help
❔ I am facing a doubt in this question.
the output seems to be wrong
25 replies
CC#
Created by BabySid on 10/6/2023 in #help
❔ I am facing a doubt in this question.
I am not getting the desired output
25 replies
CC#
Created by BabySid on 10/6/2023 in #help
❔ I am facing a doubt in this question.
this is what I've done
25 replies
CC#
Created by BabySid on 10/6/2023 in #help
❔ I am facing a doubt in this question.
csusing System;
public static class Lab4_2
{
public static void Main()
{
const int PASS = 50;
int numPass = 0, numFail = 0, totalMarks = 0;
double mark, perPass = 0, perFail = 0;

// loop to read in a valid mark or the sentinel value
do
{
// Read initial mark (seed the loop)
Console.Write("Enter a mark between 0 and 100 (-ve value to stop): ");
mark = Convert.ToDouble(Console.ReadLine());
} while (mark > 100);
// if the inputted mark is not the sentinel value, process it

while (mark >= 0)
{

// increment the counter for the total number of data values
totalMarks++;

// Determine if the mark is a pass or fail (If statement)
if (mark >= PASS)
{
numPass++;
}
else
{
numFail++;
}

// Read next mark
Console.Write("Enter mark between 0 and 100 (-ve value to stop): ");
mark = Convert.ToDouble(Console.ReadLine());
}

// Calculate the percentage of marks that were passes and fails
if (totalMarks > 0)
{
perPass = (double)numPass / totalMarks * 100;
perFail = (double)numFail / totalMarks * 100;
}

// Print results
Console.WriteLine("Total number of marks = {0}", totalMarks);
Console.WriteLine("Percentage of passing marks = {0:P1}", perPass);
Console.WriteLine("Percentage of failing marks = {0:P1}", perFail);
Console.ReadLine();
}
}
csusing System;
public static class Lab4_2
{
public static void Main()
{
const int PASS = 50;
int numPass = 0, numFail = 0, totalMarks = 0;
double mark, perPass = 0, perFail = 0;

// loop to read in a valid mark or the sentinel value
do
{
// Read initial mark (seed the loop)
Console.Write("Enter a mark between 0 and 100 (-ve value to stop): ");
mark = Convert.ToDouble(Console.ReadLine());
} while (mark > 100);
// if the inputted mark is not the sentinel value, process it

while (mark >= 0)
{

// increment the counter for the total number of data values
totalMarks++;

// Determine if the mark is a pass or fail (If statement)
if (mark >= PASS)
{
numPass++;
}
else
{
numFail++;
}

// Read next mark
Console.Write("Enter mark between 0 and 100 (-ve value to stop): ");
mark = Convert.ToDouble(Console.ReadLine());
}

// Calculate the percentage of marks that were passes and fails
if (totalMarks > 0)
{
perPass = (double)numPass / totalMarks * 100;
perFail = (double)numFail / totalMarks * 100;
}

// Print results
Console.WriteLine("Total number of marks = {0}", totalMarks);
Console.WriteLine("Percentage of passing marks = {0:P1}", perPass);
Console.WriteLine("Percentage of failing marks = {0:P1}", perFail);
Console.ReadLine();
}
}
25 replies
CC#
Created by BabySid on 10/6/2023 in #help
❔ I am facing a doubt in this question.
This is the Question
25 replies
CC#
Created by BabySid on 10/6/2023 in #help
❔ I am facing a doubt in this question.
// Name: xxxxxxxxxxxxx
// Student Number: xxxxxxx
// Lab 4 Part 2
// Program Description: This program uses a loop and if statement to input marks
// between 0 and 100) from a user, determines if the mark is pass or fail
// and outputs the percentage of passing and failing marks. The user then
// terminates the program by entering a negative value for a mark.

using System;
public static class Lab4_2
{
public static void Main()
{
const int PASS = 50;
int numPass=0, numFail=0, totalMarks=0;
double mark, perPass=0, perFail=0;

// loop to read in a valid mark or the sentinel value
do
{
// Read initial mark (seed the loop)
Console.Write("Enter a mark between 0 and 100 (-ve value to stop): ");
mark = Convert.ToDouble(Console.ReadLine());
} while (mark > 100);
// if the inputted mark is not the sentinel value, process it

while (mark >= 0)
{

// increment the counter for the total number of data values
// *** Insert code

// Determine if the mark is a pass or fail (If statement)
// *** Insert code

// Read next mark
// *** Insert code
}

// Calculate the percentage of marks that were passes and fails
// *** Insert code

// Print results
Console.WriteLine("Total number of marks = {0}", totalMarks);
Console.WriteLine("Percentage of passing marks = {0:P1}", perPass);
Console.WriteLine("Percentage of failing marks = {0:P1}", perFail);
Console.ReadLine();
}
}
// Name: xxxxxxxxxxxxx
// Student Number: xxxxxxx
// Lab 4 Part 2
// Program Description: This program uses a loop and if statement to input marks
// between 0 and 100) from a user, determines if the mark is pass or fail
// and outputs the percentage of passing and failing marks. The user then
// terminates the program by entering a negative value for a mark.

using System;
public static class Lab4_2
{
public static void Main()
{
const int PASS = 50;
int numPass=0, numFail=0, totalMarks=0;
double mark, perPass=0, perFail=0;

// loop to read in a valid mark or the sentinel value
do
{
// Read initial mark (seed the loop)
Console.Write("Enter a mark between 0 and 100 (-ve value to stop): ");
mark = Convert.ToDouble(Console.ReadLine());
} while (mark > 100);
// if the inputted mark is not the sentinel value, process it

while (mark >= 0)
{

// increment the counter for the total number of data values
// *** Insert code

// Determine if the mark is a pass or fail (If statement)
// *** Insert code

// Read next mark
// *** Insert code
}

// Calculate the percentage of marks that were passes and fails
// *** Insert code

// Print results
Console.WriteLine("Total number of marks = {0}", totalMarks);
Console.WriteLine("Percentage of passing marks = {0:P1}", perPass);
Console.WriteLine("Percentage of failing marks = {0:P1}", perFail);
Console.ReadLine();
}
}
cs
25 replies
CC#
Created by BabySid on 9/29/2023 in #help
❔ I need help with this Question?
nono
165 replies
CC#
Created by BabySid on 9/29/2023 in #help
❔ I need help with this Question?
thank you so much
165 replies
CC#
Created by BabySid on 9/29/2023 in #help
❔ I need help with this Question?
I fixed it
165 replies
CC#
Created by BabySid on 9/29/2023 in #help
❔ I need help with this Question?
yeh
165 replies
CC#
Created by BabySid on 9/29/2023 in #help
❔ I need help with this Question?
oh
165 replies
CC#
Created by BabySid on 9/29/2023 in #help
❔ I need help with this Question?
for rest of em it shows the following
165 replies