Answer:
bill = float(input("Enter the bill amount: "))
rating = int(input("Choose a rating: 1 = Totally satisfied, 2 = Satisfied, 3 = Dissatisfied.: "))
if rating is 1:
tip = bill * 0.2
elif rating is 2:
tip = bill * 0.15
elif rating is 3:
tip = bill * 0.1
print("The rating is: " + str(rating))
print("The tip is: $%.2f" % (tip))
Explanation:
*The code is in Python
- Ask the user for the <em>bill</em> and <em>rating</em>
- Depending on the <em>rating</em>, calculate the <em>tip</em> using <u>if else</u> statement i.e. If the rating is chosen as 1, calculate the tip by taking 20 percent of the bill.
- Print the <em>rating</em> and the <em>tip</em>
Answer:
100 or so atoms of the periodic table, in different combinations, make up <u>Compounds</u>.
Explanation:
Atoms from different element in the periodic table combined together with the help of bond and make a new product that is called compound.
<u>For example</u>
Hydrogen and oxygen are the elements of the periodic table. When one atom of oxygen and two atoms of hydrogen are combined together, a compound will be formed named as water (H20).
In another example, two atoms of oxygen and one atom of carbon combines toghther through chemical reaction and make compund named as Carbon dioxide (CO2).
Many admins set their firewalls to drop echo-request packets to prevent their networks from being mapped via "Ping Sweeps".
A remote possibility is that there's too many hops between the source and target and the packet's TTL expires.
Answer:
Explanation:
The following code is written in Java and it uses nested for loops to create the array elements and then the same for loops in order to print out the elements in a pyramid-like format as shown in the question. The output of the code can be seen in the attached image below.
class Brainly {
public static void main(String[] args) {
int jagged[][] = new int[5][];
int element = 1;
for(int i=0; i<5; i++){
jagged[i] = new int[i+1]; // creating number of columns based on current value
for(int x = 0; x < jagged[i].length; x++) {
jagged[i][x] = element;
element += 1;
}
}
System.out.println("Jagged Array elements are: ");
for ( int[] x : jagged) {
for (int y : x) {
System.out.print(y + " ");
}
System.out.println(' ');
}
}
}
Answer:
See the constructed 12-bit adder/subtractor from the components below
Explanation: