Answer:
import java.util.Scanner;
public class Supermarket
{
public static void main (String[] args)
{
String item;
double pounds, ounces, price,
total, unit;
Scanner scn = new Scanner(System.in);
System.out.print("Please enter the name of item ");
item = scn.nextLine();
System.out.print("Please enter the price of " + "the item per pound : ");
price = scn.nextDouble();
System.out.print("Enter the weight of " + "the item in pounds and " + "ounces respectively : ");
pounds = scn.nextDouble();
ounces = scn.nextDouble();
unit = price/16;
total = price * (pounds + ounces/16);
System.out.print("The unit price of " + "the products sold is : " + unit);
System.out.print("\nThe total cost of the " + "amount purchased is : " + total);
}
}
Explanation:
- Ask the user to enter the price of the item and the weight.
- Calculate the unit and the total price.
- Display the unit and the total price.
Answer:
<em>2) The data in question can be changed.</em>
Explanation:
<em>Mutable objects are those objects that can be changed after they are created, and they can store a a large collection of data.</em> Mutable objects are more flexible for programming as they are easily modifiable. The limitation of mutable object is that, only the copy of the object, and not the original object is mutable. This may lead to unexpected bugs in the code.
Power supply is connected
Im not sure about B. but if you can choose mutiple pick C,D,E but if you can shoose only one than pick A
Answer:
Codes are given below:
Explanation:
Since the language is not specified, I am writing it in c++
#include <iostream>
using namespace std;
int main() //Start of main function
{
int number;
cout << "Enter your number"<<endl;
cin >> number; //this will take your number as an input
cout <<"The next three numbers are: " << number + 1 << endl; //this will write the next number to your input input
cout << number + 2 << endl;
cout << number + 3 << endl;
return 0;
} //End of main function