Question: 1 . Write a program that will read input from the text file. Answer the problem below. Input: ( Input FileName: Lab 9 _ Task

1. Write a program that will read input from the text file. Answer the problem below. Input: (Input FileName: Lab9_Task1_input.txt)
The following n lines each represent a data set. Each data set will be formatted according to the following description:
A single data set consists of a line "X Y", where X is the number of brains the zombie eats and Y is the number of brains the zombie requires to stay alive.
Output: For each data set, there will be exactly one line of output. This line will be "MMM BRAINS" if the number of brains the zombie eats is greater than or equal to the number of brains the zombie requires to stay alive. Otherwise, the line will be "NO BRAINS".
Sample Input
45
33
43
Sample Output
NO BRAINS
MMM BRAINS
MMM BRAINS
1. Modified Zombies Problem Set:
The program will count how many zombies that are still alive in each set of inputs:
Example:
3
43
53
25
2
53
23
Output: (The output should be in a text file. Note Filename: Lab9_Task2_Output.txt)
2
1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!