Create a portion of a Java Program that builds five (5) elements into an ARRAY c
ID: 3570129 • Letter: C
Question
Create a portion of a Java Program that builds five (5) elements into an ARRAY called FoodDescription. The five elements (in order of entry) are: Hotdog, Fries, Hamburger, Pepsi, and IceCream.
Create another portion (added to) the above Java Program that builds five (5) elements into another ARRAY called FoodPrices. The five elements (in order of entry) are 1.50, .80, 2.25, 1.00, and .75.
Add another portion to the program you have created so far, which prints the FoodDescription and the FoodPrices in the same print statement. Your results for STEP3 should look like this:
At Billy Goat
Explanation / Answer
import java.text.DecimalFormat;
public class Test25 {
public static void main(String args[]) {
String FoodDescription[] = {"Hotdog", "Fries", "Hamburger", "Pepsi", "IceCream"};
double FoodPrices[] = {1.50, .80, 2.25, 1.00, .75};
DecimalFormat df = new DecimalFormat("#0.00");
String temp1 = "At Billy Goat
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.