Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _05.MovieRatings
- {
- class MovieRatings
- {
- static void Main(string[] args)
- {
- int numMovies = int.Parse(Console.ReadLine());
- double max = double.MinValue;
- double min = double.MaxValue;
- string movieMax = "";
- string movieMin = "";
- double average = 0.0;
- for (int i = 0; i <= numMovies; i++)
- {
- string movieName = Console.ReadLine();
- double rating = double.Parse(Console.ReadLine());
- if (rating > max)
- {
- max = rating;
- movieMax = movieName;
- //Console.WriteLine(movieMax);
- }
- if (rating < min)
- {
- min = rating;
- movieMin = movieName;
- //Console.WriteLine(movieMin);
- }
- average += rating;
- //Console.WriteLine(average / numMovies);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment