Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Question 1. 1. (TCOs 5 and 8) Write a C# loop that displays the even numbers fro

ID: 642039 • Letter: Q

Question

Question 1.1. (TCOs 5 and 8) Write a C# loop that displays the even numbers from 50 to 100. (Points : 10)

Question 2.2. PART 1 (10 points): A retail store is having a customer appreciation sale. Depending on the total dollars purchased, the customer could receive a discount on his or her total purchases. You are to develop pseudocode or C# code that will obtain the total dollars purchased from the user, determine the discount percentage, and display the total amount due. When the purchases are more than $200, the discount is 20%. When the purchases are $200 or less, the discount is 10%.

PART 2 (10 points): Create a function called calcDiscount that will calculate and return the discount amount. Write the function and call it in the code.



(Points : 20)

Question 3.3. (TCOs 5, 6, and 8) Review the following scenario and complete the design.
Scenario
Professor Higgins has asked you to design the logic that will be used to calculate final class averages and grades for his students. His grading algorithm is as follows.
      Exam average:              50%
      Quiz average:                25%
      Lab average:                 25%

< Professor Higgins has 30 students in his class. For each student, Professor Higgins will enter the studentss name and store into a names array. Then input the value for each of the averages (exam, quiz, and lab). Then using the weighting above the program will calculate the final student class average and store each students final average into an array. The program will then determine the letter grade for each student using the following criteria.
90100:                         A
8089:                          B
7079                           C
6069                           D
Less than 59                 F
When the students final grade is determined, the final grade will be stored in a third grade array.
After all data have been input and calculations done, display the final output using the three arrays as a Grade Report with headings of NAME, AVERAGE, and GRADE.
         Display the name, final average, and grade for all the students.
         Calculate and display the total class average (total of all individual student averages / number in class).


Write a program using C#, prompt the user for the appropriate input, and display the output as described above. You may assume all data are valid. Provide a program introduction message that tells the user how to use the program.


(Points : 20)

Question 1.1. (TCOs 5 and 8) Write a C# loop that displays the even numbers from 50 to 100. (Points : 10)

      
      

Question 2.2. PART 1 (10 points): A retail store is having a customer appreciation sale. Depending on the total dollars purchased, the customer could receive a discount on his or her total purchases. You are to develop pseudocode or C# code that will obtain the total dollars purchased from the user, determine the discount percentage, and display the total amount due. When the purchases are more than $200, the discount is 20%. When the purchases are $200 or less, the discount is 10%.

PART 2 (10 points): Create a function called calcDiscount that will calculate and return the discount amount. Write the function and call it in the code.



(Points : 20)

      
      

Question 3.3. (TCOs 5, 6, and 8) Review the following scenario and complete the design.
Scenario
Professor Higgins has asked you to design the logic that will be used to calculate final class averages and grades for his students. His grading algorithm is as follows.
      Exam average:              50%
      Quiz average:                25%
      Lab average:                 25%

< Professor Higgins has 30 students in his class. For each student, Professor Higgins will enter the studentss name and store into a names array. Then input the value for each of the averages (exam, quiz, and lab). Then using the weighting above the program will calculate the final student class average and store each students final average into an array. The program will then determine the letter grade for each student using the following criteria.
90100:                         A
8089:                          B
7079                           C
6069                           D
Less than 59                 F
When the students final grade is determined, the final grade will be stored in a third grade array.
After all data have been input and calculations done, display the final output using the three arrays as a Grade Report with headings of NAME, AVERAGE, and GRADE.
         Display the name, final average, and grade for all the students.
         Calculate and display the total class average (total of all individual student averages / number in class).


Write a program using C#, prompt the user for the appropriate input, and display the output as described above. You may assume all data are valid. Provide a program introduction message that tells the user how to use the program.


(Points : 20)

      
      

Explanation / Answer

1.1) for (int i = 50;i <= 100;i++)
       {
           if (i % 2 == 0)
           {
               Console.WriteLine(i);
           }
       }

2.2) Part I

using System;

public class RetailStore
{
   public static void Main(string[] args)
   {
       float totalDollarsPurchased;
       float totalAmountDue;
       Scanner s = new Scanner(System.in);
       Console.WriteLine("Enter total dollars purchased: ");
       totalDollarsPurchased = s.nextFloat();
       if (totalDollarsPurchased > 200)
       {
           totalAmountDue = (80 * totalDollarsPurchased) / 100;
       }
       else
       {
           totalAmountDue = (90 * totalDollarsPurchased) / 100;
       }
       Console.WriteLine("Total Amount Due: " + totalAmountDue);
   }
}

2.2) Part II

using System;

public class RetailStore
{

   public virtual float calcDiscount(float totalDollarsPurchased)
   {
       float discount;
       if (totalDollarsPurchased > 200)
       {
           discount = (20 * totalDollarsPurchased) / 100;
       }
       else
       {
           discount = (10 * totalDollarsPurchased) / 100;
       }
       return discount;
   }

   public static void Main(string[] args)
   {
       float totalDollarsPurchased;
       Scanner s = new Scanner(System.in);
       Console.WriteLine("Enter total dollars purchased: ");
       totalDollarsPurchased = s.nextFloat();
       RetailStore rs = new RetailStore();
       Console.WriteLine("Total Amount Due: " + (totalDollarsPurchased - rs.calcDiscount(totalDollarsPurchased)));
   }
}

3.3) using System;

public class StudentGrade
{
   private string[] names = new string[30];
   private int[] exam = new int[30];
   private int[] quiz = new int[30];
   private int[] lab = new int[30];
   private float[] avg = new float[30];
   private char[] grade = new char[30];
   public virtual void getData()
   {
       Scanner s = new Scanner(System.in);
       for (int i = 0;i < 30;i++)
       {
           Console.WriteLine("Enter name: ");
           names[i] = s.next();
           Console.WriteLine("Enter exam average: ");
           exam[i] = s.Next();
           Console.WriteLine("Enter quiz average: ");
           quiz[i] = s.Next();
           Console.WriteLine("Enter lab average: ");
           lab[i] = s.Next();
       }
   }
   public virtual void calcAverage()
   {
       for (int i = 0;i < 30;i++)
       {
           avg[i] = (exam[i] + quiz[i] + lab[i]) / 3;
       }
   }
   public virtual void calcGrade()
   {
       for (int i = 0;i < 30;i++)
       {
           if (avg[i] >= 90 && avg[i] <= 100)
           {
               grade[i] = 'A';
           }
           else if (avg[i] >= 80 && avg[i] <= 89)
           {
               grade[i] = 'B';
           }
           else if (avg[i] >= 70 && avg[i] <= 79)
           {
               grade[i] = 'C';
           }
           else if (avg[i] >= 60 && avg[i] <= 69)
           {
               grade[i] = 'D';
           }
           else
           {
               grade[i] = 'F';
           }
       }
   }
   public virtual void displayGradeReport()
   {
       Console.WriteLine("Name Avg Grade");
       for (int i = 0;i < 30;i++)
       {
           Console.WriteLine(names[i] + " " + avg[i] + " " + grade[i]);
       }
       float sum = 0, totalClassAvg = 0;
       for (int i = 0;i < 30;i++)
       {
           sum += avg[i];
       }
       totalClassAvg = sum / 30;
       Console.WriteLine("Total class average: " + totalClassAvg);
   }
   public static void Main(string[] args)
   {
       StudentGrade s = new StudentGrade();
       s.Data;
       s.calcAverage();
       s.calcGrade();
       s.displayGradeReport();
   }
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote