$24
MINIMUM SUBMISSION REQUIREMENTS:
Create a folder lab1
FeedBabe.XXX in the lab1 folder (where XXX is the extension for one of the approved programming languages listed below)
output.txt in the lab1 folder
README.txt in the lab1 folder
Commit and Push your repository
A Google form submitted with the Commit ID taken from your GITLAB web interface verifying that the above files are correctly named in their correct folders
All of the above must be completed by the lab due date
LAB OBJECTIVE:
This lab will verify that you have the prerequisite programming background by having you program a simple task in the programming language of your choice (see list below). This class has a prerequisite of programming experience; this should not be a hard task. You WILL NOT BE able to complete the lab if you start it the day it is due (this will be true of all subsequent labs as well).
If you spend more than an hour or two to program this lab, or need to spend time looking up solutions on the web, then you do not have the prerequisite knowledge to succeed in this class. If this is difficult for you, you will be better off taking an introductory programming class and coming back to CE12 when you are ready.
Be very careful about using code you find on the web. The code you turn in MUST BE YOUR OWN. It does not matter if you understand the code; if you did not create it, it isn’t yours. This is an academic integrity violation pure and simple. Failure to meet the minimum submission requirements listed will result in failing the class (see syllabus). This will be true for all subsequent labs as well.
This program is to iterate through a set of integers (1-500) and output one of four outputs depending on the number: if the number is divisible (no remainder) by 3, then the output is “FEED.” If the number is evenly divisible by 4, then the output is “BABE.” If the output is divisible by both 3 and 4, then the output should be “FEEDBABE”. Lastly, if the output is not divisible by either 3 or 4, then the number itself should be printed. Each entry is on its own line. You will be submitting both the code and the output.
The program should PRINT the information to the screen (standard output) and not save it to a file. To create output.txt, you should manually copy the output from your program running into the file.
This program is also something of a first non-trivial program beyond the “hello world” and similar programming assignments are used in hiring interviews all the time.
ACCEPTABLE PROGRAMMING LANGUAGES AND STANDARD FILE EXTENSIONS:
In this lab we are allowing you to use any programming language of your choice given that the prerequisite is programming experience (without specification of any specific programming language). In order to be reasonable we have limited this to the most popular languages summarized in the table
below. The extension you put on the file in the repo will inform the grading script which language to invoke. Make sure that you match the file extension to the language that you are using.
Progamming Language
File extension
C (ANSI C or C90)
.c
C++ (C++98)
.cpp
Python 3.6
.py
Java
.java
Ruby
.rb
If there is another language you need to use that is not on this list, contact the instructional staff via Piazza as soon as possible, and we will see about accommodating it.
LAB SPECIFICATIONS:
This program is to iterate through a set of integers (1-500) and output one of four outputs depending on the number: if the number is divisible (no remainder) by 3, then the output is “FEED.” If the number is evenly divisible by 4, then the output is “BABE.” If the output is divisible by both 3 and 4, then the output should be “FEEDBABE”. Lastly, if the output is not divisible by either 3 or 4, then the number itself should be printed. Each entry is on its own line. You will be submitting both the code and the output.
Program iterates through the integers 1 to 500
If the number is divisible by 3 output: FEED
If the number is divisible by 4 output: BABE
If the number is divisible by both 3 and 4 output: FEEDBABE
If the number is NOT divisible by either 3 or 4 output the number itself
You will turn in your code in a file named FeedBabe.XXX where XXX is the correct file extension corresponding to the language you used (see table above). For example, if C were used, the file would be FeedBabe.c
You will turn in the output generated by your code in a plain text file named output.txt
You will edit your README.txt file to include your name, CruzID, which programming language you used to code up the assignment, and any notes about your code that you wish to include. Each of these should be on a separate line.
NOTES:
This lab is quite short but if you are rusty in your programming it can take some time. Start early and there should be no issues with finishing it well before the due date. This lab is really a check on the prerequisite programming knowledge required to succeed in this class; if you cannot complete this easily, we strongly recommend you take an introductory programming class and come back another term when you are ready.
Ensure that you have met the minimum submission requirements. Failure to meet this requirement will result in failing the class regardless of any other scores. You can submit a new commit ID as many times as you like, we will always grade the last one you submit on the google form. Also note that until you push, the files don’t exist in a place where we can get to them. This is how the program knows which files to pull from your repository. This is why we need the commit ID to match what you want to turn in.
One reminder about committing and pushing: You should get in the habit of committing early and often. This is very easy to do, and guarantees that you have something turned in. Every time you make a change, add a file, modify a file, go ahead and commit and push. You will always be able to return to that place and never lose your work.
SAMPLE OUTPUT:
This program will generate a file with 500 lines in the output. You will need to capture that to a file for the output.txt file that you will turn in. Each line in the file should be either a number, the text FEED, BABE, or FEEDBABE. The number does not appear on a line in which FEED, BABE, or FEEDBABE appears. The words should be in all capital letters. The output file should be plain text (no formatting).
Below is the output of the code run from the number 1 to 25 demonstrating what the output should look like (further output is truncated to prevent this lab description from being too long!):
1
2
FEED
BABE
5
FEED
7
BABE
FEED
10
11
FEEDBABE
13
14
FEED
BABE
17
FEED
19
BABE
FEED
22
23
FEEDBABE
25
Lastly, just to show you the pattern you should see at the end (you should actually get to the number 500) the last 20 entries are:
481
482
FEED
BABE
485
FEED
487
BABE
FEED
490
491
FEEDBABE
493
494
FEED
BABE
497
FEED
499
BABE