We have 002 Blue pants that cost $24.99.

Given:

public class Print01 {

public static void main(String[] args) {

double price = 24.99;

int quantity = 2;

String color = “Blue”;

// insert code here. Line ***

}

}

Which two statements, inserted independently at line ***, enable the program to produce the following output:

We have 002 Blue pants that cost $24.99.

Given:

public class Print01 {

public static void main(String[] args) {

double price = 24.99;

int quantity = 2;

String color = “Blue”;

// insert code here. Line ***

}

}

Which two statements, inserted independently at line ***, enable the program to produce the following output:

We have 002 Blue pants that cost $24.99.

A.
System.out.printf(“We have %03d %s pants that cost $%3.2f.\n”,quantity, color, price);

B.
System.out.printf(“We have$03d$s pants that cost $$3.2f.\n”,quantity, color, price);

C.
String out = String.format (“We have %03d %s pants that cost $%3.2f.\n”,quantity, color, price); System.out.println(out);

D.
String out = System.out.format(“We have %03d %s pants that cost $%3.2f.”,quantity, color, price);
System.out.println(out);

E.
System.out.format(“We have %s%spants that cost $%s.\n”,quantity, color, price);



Leave a Reply 2

Your email address will not be published. Required fields are marked *