Answer:
Explanation:
The following program is written in Java. Using the program code from Purchase class in 5.13 I created each one of the fruit objects. Then I set the price for each object using the setPrice method. Then I set the number of each fruit that I intended on buying with the setNumberBought method. Finally, I called each objects getTotalCost method to get the final price of each object which was all added to the totalCost instance variable. This instance variable was printed as the total cost of the bill at the end of the program. My code HIGHLIGHTED BELOW
//Entire code is in text file attached below.
//MY CODE HERE
DecimalFormat df = new DecimalFormat("0.00");
oranges.setPrice(10, 2.99);
oranges.setNumberBought(2*12);
eggs.setPrice(12, 1.69);
eggs.setNumberBought(2*12);
apples.setPrice(3, 1);
apples.setNumberBought(20);
watermelons.setPrice(1, 4.39);
watermelons.setNumberBought(2);
bagels.setPrice(6, 3.50);
bagels.setNumberBought(12);
totalCost = oranges.getTotalCost() + eggs.getTotalCost() + apples.getTotalCost() + watermelons.getTotalCost() + bagels.getTotalCost();
System.out.println("Total Cost: $" + df.format(totalCost));
}
}
Answer:
#include <bits/stdc++.h>
using namespace std;
// driver function
int main()
{
// variables
const double g = 9.8;
int sec;
double height;
int t = 0;
double d = 0;
bool flag = false;
// ask to enter time
cout << "Please enter the time of fall(in seconds):";
// read time
cin >> sec;
//ask to enter height
cout << "Please enter the height (in meters):";
//read height
cin >> height;
cout << '\n'
<< "Time(seconds) Distance(meters)\n"
"********************************\n";
// calculate height after each seconds
while ( t <= sec) {
cout << setw(23) << left << t
<< setw(24) << left << d << '\n';
// if input height is less
if ( d > height ) {
flag = true;
}
// increament the time
t += 1;
// find distance
d = 0.5 * g * (t) * (t);
}
cout << '\n';
// if input height is less then print the Warning
if ( flag ) {
cout << "Warning - Bad Data: The distance fallen exceeds the height"
" of the bridge.\n";
}
return 0;
}
Explanation:
Read the time in seconds from user and assign it to "sec" then read height and assign it to "height".After this find the distance after each second.If the input height is less than the distance at any second, it will print a Warning message. otherwise it will print the distance after each second.
Output:
Please enter the time of fall(in seconds):11
Please enter the height (in meters):1111
Time(seconds) Distance(meters)
********************************
0 0
1 4.9
2 19.6
3 44.1
4 78.4
5 122.5
6 176.4
7 240.1
8 313.6
9 396.9
10 490
11 592.9
Answer:
A Standard Lens
Explanation:
Since David wants to take pictures of people around him and also the objects far away, a standard lens would be fit for that.
The factors which should be considered by Daniel are the RAM capacity and the Processor Core of the computer.
Computer games especially racing and football games are usually memory intensive and as such will require a good amount of RAM in other to ensure that the game runs smoothly as the RAM provides a temporary storage required for applications or programs to run smoothly.
Also, the processor core has to be put into consideration, Daniel will need a multi - core processor in other to aid the smooth running of his racing game.
Therefore, the factors that should be considered are the RAM and processor core.
Learn more :brainly.com/question/25010930
Answer:
false
Explanation:
parasynthesis is used to change the order of priority.