Answer to Question #156732 in C# for Ali

Question #156732

Create a program to generate student attendance record in which teacher mark absent or present of each student and student have capability to see their attendance record of their each subjects.

Note: Your work must be done on console application.


1
Expert's answer
2021-01-20T02:32:40-0500
using System;
class HelloWorld {
  static void Main() {
    Console.WriteLine("#=#=# In this program the teacher can mark the students are present or absent. #=#=#");
    
    // A array of pupils  
    string[] students = { "Mahesh Chand", "Jeff Prosise", "Dave McCarter", "Allen O'neill", "Tim Bernars", "Isaak Nyuton", "Gal Gadot",
                         "Monica Rathbun", "Henry He", "Raj Kumar", "Mark Prime", "Erse Bilgec", "Ottofon Bismark", "Tom  Holland", 
                         "Rose Tracey", "Mike Crown", "Jeff Bezos", "Mark Serikuli", "Ali Berduri", "Tony Stark" }; 
    char[] marks = {'+', '-'};
                    
    // Create a Random object  
    Random rand = new Random();  
    Console.WriteLine("Enter the number of students: ");
    int n = Convert.ToInt32(Console.ReadLine());
    
    for (int i = 0; i < n; i++) {
        // Generate a random i less than the size of the array.  
        int index = rand.Next(students.Length);
        int index1 = rand.Next(marks.Length);
        Console.WriteLine("{0} | {1} |", students[index], marks[index1]);  
    }
  
    Console.ReadKey(); 
  }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS