Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Program
- {
- public static void Main(string[] args)
- {
- int nationalAvg;
- School s1 = new School("School number 1", "Tel-Aviv", 81);
- School s2 = new School("School number 2", "Beer-Sheva", 81);
- nationalAvg = (s1.getPercent() + s2.getPercent()) / 2;
- if(s1.getPercent() >= 80 && s1.getPercent() > nationalAvg)
- {
- s1.setCategory(1);
- }
- else if(s1.getPercent() >= 70 && s1.getPercent() >= nationalAvg)
- {
- s1.setCategory(2);
- }
- if (s2.getPercent() >= 80 && s2.getPercent() > nationalAvg)
- {
- s2.setCategory(1);
- }
- else if (s2.getPercent() >= 70 && s2.getPercent() >= nationalAvg)
- {
- s2.setCategory(2);
- }
- if(s1.getCategory() == s2.getCategory())
- {
- Console.WriteLine("The schools are in the same category");
- }
- s1.pInfo();
- s2.pInfo();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement