Question: Create a new project in IntelliJ. (Name it whatever you want, such as lab4-conversions.) Create a new class in the package named ConversionFunctions . (Right-click

  1. Create a new project in IntelliJ. (Name it whatever you want, such as lab4-conversions.)
  2. Create a new class in the package named ConversionFunctions. (Right-click on the package you just created (under src) and select New->Java Class. Type the class name exactly as given and click OK.)
  3. Delete all the source code for ConversionFunctions.java and copy in the source code found here: Lab 4 ConversionFunctions Starting Source Code.
  4. Create an associated JUnit test class called ConversionFunctionsTest. See Create a JUnit Test Class in IntelliJ.
  5. Delete all the source code for ConversionFunctionsTest.java and copy in the source code found here: Lab 4 ConversionFunctionsTest Starting Source Code.
  6. Complete the TODOs in ConversionFunctionsTest, writing tests, and fixing bugs.
/** * A library of conversion functions * * @author Cara Tang * @version 2018.04.14 */ public class ConversionFunctions { private static final String[] MONTH_NAMES = { "", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" }; /** * Convert a temperature from celsius to fahrenheit * @param celsius temperature in degrees celsius * @return the fahrenheit equivalent of the given celsius temp */ public static int celsiusToFahrenheit(int celsius) { return (int)(Math.round(9.0*celsius/5) + 32); } /** * Convert cups to tablespoons. There are 16 tablespoons in a cup. * @param cups the number of cups to convert * @return the number of tablespoons in the given number of cups */ public static int cupsToTablespoons(int cups) { // This method does not work correctly. You will fix it as you work through the tests. // Remove these comments once it is implemented correctly. return 0; } /** * Convert a month number to the string name of the month * @param monthNum a month number, from 1 to 12 * @return the name of the given month, or empty string if the month number is invalid */ public static String monthNumToMonthName(int monthNum) { // This method does not work correctly. You will fix it as you work through the tests. // Remove these comments once it is implemented correctly. return MONTH_NAMES[monthNum]; } }

It is not required that you track this project in Git, but you may do so if you like. However, do not put this project in a public repository on GitHub.

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 Databases Questions!