Question: Instructions: 1. Create a new NetBeans project called yourname assignment2 2. Prompt the user to enter a data line string. 3. Read the input from
Instructions: 1. Create a new NetBeans project called yourname assignment2 2. Prompt the user to enter a data line string. 3. Read the input from the keyboard with nextLine), and store it in a String variable. Note: Do not read the individual fields separately; the whole line must be read into one variable For each of the three parts (name, square feet, blocks), pull the data field of interest out of the data line. 4. o Use the methods in the table on the previous page to do the following: Use the appropriate delimiting character in the line to locate each data field Store each data field to an appropriately-typed variable . Include only the text portions for each data field, do not include the delimiting characters. HINT: you will need more than one method to pull data fields out of the data line. What information do you need before you can assign the data field to a variable? HINT: there are many possible ways to encode this logic. Your approach may not be the same as other classmates' approaches. As long as your logic meets the requirements in this specification, it's a good approach. HINT: you may not need all of the methods listed in the table, but all are potentially useful. o o o o 5. Convert the square feet to an integer using the Integer.parselnt method and number of blocks to a double using the Double.parseDouble method. Use these numeric types to compute the daily price Print out the results, following the examples in the sample output. Be sure to follow these examples closely, including output wording, spacing, and punctuation. 6. 7. When your code is working, upload your java file to the Assignment 2 dropbox. SAMPLE OUTPUT Enter one data line Palm Springs Apt,1200,2.5,4-75 Results roperty name: Palm Springs Apt Sqft: 1200 Blocks: 2.5 Pzice: 515.5 Total characters: 32 Pzocessed: 28 Unprocessed: 4 BUILD SUCCESSFUL (total time: 2 seconds)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
