Lab 2
Start Now
## Overview The purpose of this assignment is to gain experience writing in Java. ## Details Your instructor may ask you to implement code for this laboratory assignment in IntelliJ or [CodingBat](http://codingbat.com). Be sure to follow your instructor's instructions. ### Negate Given a number, return its negative. * [CodingBat](http://codingbat.com/prob/p214698) ### How Many Pennies Given a number representing dollars and cents, e.g. 2.18, return the number of pennies corresponding to that amount. * [CodingBat](http://codingbat.com/prob/p298768) ### Last Half Given a non-empty string with an even number of characters, return the last half. E.g., Given "this" return "is". * [CodingBat](http://codingbat.com/prob/p209168) ### Make Initialization Make a program that writes a line of Java code. Given the name of the variable and its value, return an initialization of an int with that name and value. E.g., given the name "x" and the value "5", return "int x = 5;" * [CodingBat](http://codingbat.com/prob/p257464) ### Fraction Given a fraction expressed as a numerator and denominator, return the fraction as a floating point number. * [CodingBat](http://codingbat.com/prob/p242795) ### Sample Console Interaction If you are required to use IntelliJ for your implementation, your program interaction should look like this: <pre> 1. Negate Enter an integer value: -3 Result: 3 2. How Many Pennies Enter a dollar amount: 2.18 Result: 218 3. Last Half Enter a word: this Result: is 4. Make Initialization Enter a name: x Enter an integer value: 5 Result: int x = 5; 5. Fraction Enter a numerator: 1 Enter a denominator: 2 Result: 0.5 </pre> ## Acknowledgement This laboratory assignment was developed by [Dr. Chris Taylor](/taylor/) and [Dr. Josiah Yoder](http://faculty-web.msoe.edu/yoder). ## Lab Deliverables <div class="notetip">See your professor's instructions for details on submission guidelines and due dates. <center> See Prof. Jones for instructions<br /> See Dr. Retert for instructions<br /> Dr. Taylor's class: complete in codingbat.com; Due 11pm the day of lab<br /> See Dr. Thomas for instructions </center> If you have any questions, consult your instructor.</div>

Friday, 08-Sep-2017 13:57:26 EDT