Answer:
widgets=float(input("Enter number of widgets you want to buy"))
if widgets<0:
print("Can't compute negative number")
else:
if widgets<100:
cost=widgets*25
else:
cost=widgets*20
print("The total cost of widgets is", cost,"cents")
Explanation:
First I made a variable called widgets to take input of the number of widgets the customer wants to buy. I use the first comditional statement to test if the number of items typed in is not less than zero.
The else statement computed the prices of widgets based on number of widgets greater than zero.
Another conditional statement to check if the widgets is lower that 100 or greater. The cost represents the total amount, in terms of cost it will take for some nuber of widgets.
The last line prints the total cost and some statments
ArrayList‹double› aList = new ArrayList‹double›(10); correctly declares an ArrayList
a. ArrayList‹double› aList = new ArrayList‹double›(10);
<u>Explanation:</u>
In programming language to store more value of same data type single or double dimensional array.
For example if end user is store 25 value of same data type, he or she can’t defined 25 variable and access is very hard in the programming languages.
To avoid these of type situation end user use single or double dimensional array where can store 25 values.
Singled dimensions each cell access by cell no,
Double dimension each cell access by row no, cell no
In above scenario it is defined as single dimensional array with 10 cells and data type is double.
The CPU is the brain of a computer, containing all the circuitry needed to process input, store data, and output results. The CPU is constantly following instructions of computer programs that tell it which data to process and how to process it.
Answer:
Sorry mate I tried but I got it wrong!
Explanation:
Sorry again