20.1k views
2 votes
Using two statements on separate lines, declare integer variables named newSales and totalSales. (Do not initialize the variables.)

User Grimus
by
4.1k points

1 Answer

1 vote

Answer:

int newSales;

int totalSales;

Step-by-step explanation:

The code has been written in Java.

To declare a variable in Java, all you need is to give its type followed by the name of the variable and then a semicolon. i.e

[ datatype ] [ variablename ] [ ; ]

In this case the variables are of type integer (int) and there names are newSales and totalSales.

Therefore declaring the variables can be written as follows:

int newSales;

int totalSales;

Hope this helps!

User Millinon
by
3.9k points