Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace _2015_C_sharp_Exam
- {
- class Program
- {
- /*
- el mas2ala de el doctor msh mewada7 feeha ay tafaseel ..
- fa ana ha7el 3ala 7asab ma fehemt we bel taree2a elly
- te3gebny , momken kol wa7ed ye7elaha b taree2a ..
- ScreenShot of Console : http://i.imgur.com/6k3hpsz.png
- */
- static void Main(string[] args)
- {
- //question 3 - c
- Console.Write("Enter the number of students : ");
- int NumberOfStudents = int.Parse(Console.ReadLine());
- Console.Write("Enter the number of questions : ");
- int NumberOfQuestions = int.Parse(Console.ReadLine());
- char[] questionAnswer = new char[NumberOfQuestions];
- Console.WriteLine("Enter the answer key of each question : ");
- for(int i = 0; i < NumberOfQuestions; i++)
- {
- questionAnswer[i] = char.Parse(Console.ReadLine());
- }
- for(int i = 0; i < NumberOfStudents; i++)
- {
- Console.WriteLine("Enter the question Answer of student {0} :" , i+1);
- int counter = 0;
- for(int y = 0; y < NumberOfQuestions; y++)
- {
- char answer = char.Parse(Console.ReadLine());
- if(answer == questionAnswer[y])
- {
- counter++;
- }
- }
- Console.WriteLine("Student {0} solved {1} correct answers" , i+1 , counter);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement