The program is a sequential program; as such, it does not require loops or conditional statements.
The program in Python, where comments are used to explain each line is as follows:
#This gets input for the cost of the meal
cost = float(input("Cost: "))
#This initializes the local rate tax to 7.25%
local_rate_tax = 0.0725
#This initializes the tip to 18%
tip = 0.18
#This calculates the tax amount
taxAmount = cost * local_rate_tax
#This calculates the tip amount
tipAmount = cost * tip
#This calculates the grand total
grand = cost + taxAmount + tipAmount
#This prints the tax amount
print("Tax amount: {:.2f}".format(taxAmount))
#This prints the tip amount
print("Tip: {:.2f}".format(tipAmount))
#This prints the grand total
print("Grand total: {:.2f}".format(grand))
All outputs are formatted to 2 decimal places.
See attachment for sample run
Read more about similar programs at:
Answer:
Explanation
If I were calculating a tip at a restaurant using the same syntax, it would have been. meal ... New value of meal is double meal times tax. you're saying: (meal + meal) * tax but meal + meal * tax is calculated in the following order meal + (meal * tax) ... eh? ;) The exercise implied it was just reading the equation from right to left.
Answer:
Implemented using Python
n = int(input("Sides: "))
if(n>=1 and n <=50):
for i in range(1,n+1):
for j in range(1,i+1):
print('*',end='')
print("")
for i in range(n,0,-1):
for j in range(i,1,-1):
print('*',end='')
print("")
else:
print("Range must be within 1 and 50")
Explanation:
This line prompts user for number of sides
n = int(input("Sides: "))
The line validates user input for 1 to 50
if(n>=1 and n <=50):
The following iteration uses nested loop to print * in ascending order
for i in range(1,n+1):
for j in range(1,i+1):
print('*',end='')
print("")
The following iteration uses nested loop to print * in descending order
for i in range(n,0,-1):
for j in range(i,1,-1):
print('*',end='')
print("")
The following is executed if user input is outside 1 and 50
else:
print("Range must be within 1 and 50")
B. outrageous and crazy.
C. stern and authoritative.
D. dark and serious.
placeholder
action button
transition
animation
Hey
I think that the answer placeholder :)
Sry if im wrong tho
Answer:
The answer is placeholder.
Answer:
function Enlistee( name, number ){
constructor( ){
super( ) ;
this.name= name;
this.number= number;
this.Private= ( platoonNumber, yearOfService ) =>{
this.platoonNumber = platoonNumber;
this.yearOfService = yearOfService;
}
}
}
Explanation:
In Javascript, OOP ( object-oriented programming) just like in other object oriented programming languages, is used to create instance of a class object, which is a blueprint for a data structure.
Above is a class object called Enlistee and subclass "Private" with holds data of comrades enlisting in the military.
Page Design tab
Zoom bar
Answer:
Page pane
Explanation:
This pane is present under the navigation pane, it allow to hop easily from one page to other. Moreover pages can be added using Add Page button.
Page pane makes the view and navigation from on page to another easier and quicker.
package brainly;
import java.util.*;
/**
*
* @author CotrinaAlejandra
*/
public class Brainly {
/*Provide the java code, including a comment with your name, course code and date.
Name:
Course:
Date: */
public static void main(String[] args) {
// TODO code application logic here
int number;
Scanner sc = new Scanner(System.in);
System.out.print("Write a four digit number: ");
number=sc.nextInt();
String newLine= String.valueOf(number);
System.out.println(newLine.charAt(0)+" "+newLine.charAt(1)+" "+newLine.charAt(2)+" "+newLine.charAt(3));
}
}