20 Jul MIDTERM CIS 1101
CIS 1101 Midterm Examination Dr. Kendall E. Martin Directions: Complete all questions. Point values are listed next to each. You may use your one sheet of crib notes and the Visual Logic tool. For each VL solution, copy a screen shot of your program into a Word doc. Print that out to submit at the end of the exam period. Question 1. (15 pts) Write a Visual Logic program that prompts the user to enter their age in years. The program should then convert that data into dog years using the well known rule: 1 dog year = 7 human years The program should then print out a message. If the equivalent dog age is greater than 5, print: WOW! As a dog, you’re more than half used up ! You are xxxx dog years old. If the dog age is less than 5 , print: Cool – you are just a pup! Only xxx dog years old. Question 2 (10 pts) Add error checking to the program in question 1. If the user enters an age that is silly ( that is, it can’t be negative and it can’t be greater than 117 ! ), force them to re-enter the age until they give something that is reasonable. Question 3 (15 pts) Write a Visual Logic program that reads from the user a list of five names and towns. After you have read these in, print out both lists side by side but in reverse order so the first pair you will print is the last pair entered. For example, if the user entered: Kendall Lansdale Jordan Red Hook Brett Poughkeepsie Marina Bangladesh Peri New York Then the program will print out :
Peri New York Marina Bangladesh Brett Poughkeepsie Jordan Red Hook Kendall Lansdale Question 4 (10 pts) Describe three things that happen when the INPUT statement from Visual Logic is executed. Question 5 (15 pts) Here is a program written in Visual Basic. Create the same program in Visual Logic. Explain what it does by showing the output for a range of input values. Sub Main() Dim MYSTERY Dim ANSWER Console.Write(“Please Enter a Value For mystery:”) mystery = Console.ReadLine() answer = (mystery / 6) + 5 If ((answer < 15) and (mystery mod 2 = 0)) Then Console.WriteLine(“one message”) Else Console.WriteLine(“other message”) End If Console.WriteLine(“”) Console.WriteLine(“Program Complete… Press <Enter> to close…”) Console.ReadLine() End Sub Question 6 (10 pts) Write a Visual Logic program that simulates rolling two dice a thousand times. Count and display how many times you roll a six on only one of the die. Question 7 (10 pts) Write a Visual Logic program that rolls two dice. Count how many times you roll before you find you have rolled double sixes. Display that value. Question 8 (15 pts) Discuss the steps you would take to teach yourself a new programming language, Python. Extra credit : (10 pts) Think back to question 7. How many rolls does it take before you roll double sixes on two consecutive tosses?
Our website has a team of professional writers who can help you write any of your homework. They will write your papers from scratch. We also have a team of editors just to make sure all papers are of HIGH QUALITY & PLAGIARISM FREE. To make an Order you only need to click Ask A Question and we will direct you to our Order Page at WriteDemy. Then fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.
Fill in all the assignment paper details that are required in the order form with the standard information being the page count, deadline, academic level and type of paper. It is advisable to have this information at hand so that you can quickly fill in the necessary information needed in the form for the essay writer to be immediately assigned to your writing project. Make payment for the custom essay order to enable us to assign a suitable writer to your order. Payments are made through Paypal on a secured billing page. Finally, sit back and relax.
About Writedemy
We are a professional paper writing website. If you have searched a question and bumped into our website just know you are in the right place to get help in your coursework. We offer HIGH QUALITY & PLAGIARISM FREE Papers.
How It Works
To make an Order you only need to click on “Order Now” and we will direct you to our Order Page. Fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.
Are there Discounts?
All new clients are eligible for 20% off in their first Order. Our payment method is safe and secure.