1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Ksenya-84 [330]
2 years ago
6

Create a program with three overloaded computeBill() methods for a photo book store.

Computers and Technology
1 answer:
xeze [42]2 years ago
6 0

Using computational language in JAVA it is possible to write a code that deals with the fees applied in a total when buying a photobook.

<h3>Writing this code in JAVA we have:</h3>

<em>public class Billing {</em>

<em>    final static double TAX = 0.08;</em>

<em>    public static void main(String[] args) {</em>

<em>        final double HIGHPRICE = 24.99;</em>

<em>        final double MEDPRICE = 17.50;</em>

<em>        final double LOPRICE = 10.00;</em>

<em>        final int QUAN1 = 4;</em>

<em>        final int QUAN2 = 6;</em>

<em>        double bill;</em>

<em>        bill = computeBill(HIGHPRICE);</em>

<em>        System.out.println("The total for a photobook that costs $" +</em>

<em>                HIGHPRICE + " is $" + bill);</em>

<em>        bill = computeBill(MEDPRICE, QUAN1);</em>

<em>        System.out.println("The total for " + QUAN1 +</em>

<em>                " photobooks that cost $" +</em>

<em>                MEDPRICE + " is $" + bill);</em>

<em>        bill = computeBill(LOPRICE, QUAN2, 20.00);</em>

<em>        System.out.println("The total for " + QUAN2 +</em>

<em>                " photobooks that cost $" +</em>

<em>                LOPRICE + " with a $20 coupon is $" + bill);</em>

<em>    }</em>

<em>    public static double computeBill(double amt) {</em>

<em>        return amt * (1 + TAX);</em>

<em>    }</em>

<em>    public static double computeBill(double amt, int quantity) {</em>

<em>        return amt * quantity * (1 + TAX);</em>

<em>    }</em>

<em>    public static double computeBill(double amt, int quantity, double coupon) {</em>

<em>        return (amt * quantity - coupon) * (1 + TAX);</em>

<em>    }</em>

<em>}</em>

See more about JAVA at brainly.com/question/12975450

#SPJ1

You might be interested in
class Login: def __init__(self): self.login_name = 'none' self.login_password = 'none' # TODO: Define class method - check_crede
Gnoma [55]

Create boolean variable that receives return value from # calling check_credentials(login, password) # TODO a loop that will continue until login attempts run out or a successful login is returned # TODO #elegance Login elegance Login: #_init def _init_(self)  #initializing login_name as none self.login_name = 'none'.

<h3>What is a code in programming?</h3>

In laptop programming, laptop code refers back to the set of instructions, or a device of rules, written in a specific programming language (i.e., the supply code). It is likewise the time period used for the supply code after it's been processed via way of means of a compiler and made equipped to run at the laptop (i.e., the item code).

  1. CODE
  2. #elegance Login
  3. elegance Login:
  4. #_init_
  5. def _init_(self):
  6.  #initializing login_name as none
  7.  self.login_name = 'none'
  8.  #initializing login_password as none
  9.  self.login_password = 'none' #check_credentials()
  10. def check_credentials(self, user_login, user_passwd):
  11.  #initializing simlogin as 'Test'
  12.  simlogin = 'Test' #initializing simpass as 'Test'
  13.  simpass = 'test1234' #if consumer despatched an appropriate credentials
  14.  if user_login == simlogin and user_passwd == simpass:
  15.   #print "Successful login!"
  16.   print("Successful login!")
  17.   #returns False
  18.   go back False
  19.    #returns False
  20.   go back False
  21.   #timeout variable used for login attempts
  22. timeout = five
  23. #spark off for password
  24. password = input()
  25. #if now no longer legitimate login
  26.  else:
  27.   #decrements timeout
  28.  timeout = timeout - 1
  29.   #if timeout equals 0
  30.   if timeout == 0:
  31.    #prints "five failed login attempts. No extra login attempts."
  32.    print("five failed login attempts. No extra login attempts.")
  33.     #exits the loop
  34.    break
  35.  #spark off for consumer call
  36.  login = input()

Read more about the code:

brainly.com/question/4514135

#SPJ1

4 0
2 years ago
Write a program that converts degrees Fahrenheit to Celsius using the following formula. degreesC = 5(degreesF – 32)/9 Prompt th
weeeeeb [17]

Answer:

Written in Python

import math

degreesF = float(input("Enter a temperature in degrees Fahrenheit: "))

degreesC = round(5 * (degreesF - 32)/9,1)

print(degreesC)

Explanation:

The following header allows you to use Math.Round() method in Python

import math

The following prompts the user for temperature in degrees Fahrenheit

degreesF = float(input("Enter a temperature in degrees Fahrenheit: "))

The following calculates the degree Celsius equivalent and also round it up

degreesC = round(5 * (degreesF - 32)/9,1)

The following prints the degree Celsius equivalent

print(degreesC)

5 0
3 years ago
ASAP BRAINLIEST
Softa [21]
True............................
8 0
3 years ago
Read 2 more answers
Assume you define a vector in the following way:
salantis [7]

Answer:

vec[0].push_back(10)

Explanation:

Given

Declaration: vector <int> vec

Required

Assign 10 to the first element

This can be done using the push_back keyword.

The syntax is:     <em>vectorname[position].push_back(value); </em>

In this case:

vectorname = vec

position = 0 i.e. first element

value = 10

So, we have:

vec[0].push_back(10)

6 0
3 years ago
Given a long integer representing a 10-digit phone number, output the area code, prefix, and line number using the format (800)
Alexxandr [17]

Answer:

See explanation!

Explanation:

Here we have a program written in C++ language. Each // symbol is a relative comment explaining the reason for each command line (and is not included during the program execution).

<em>The Program: </em>

#include <iostream>

<em>//c++ build in library</em>

using namespace std;

<em>//main code body starts here</em>

int main()

{

 <em> //declare variable to store phone numbers,its area code, prefix and line    number.</em>

  long pnumber;   <em>//declare long variable</em>

  int ac, prefix, lnumber;

 <em> //declare integer variables, where ac: Area Code and lnumber is the Line Number</em>

  cout<<"Enter a 10-digit Phone Number: "<<endl;

  <em>//cout command prints on screen the desired message</em>

  cin>>pnumber;

 <em> //cin command enables the user to interact with the programm and enter information manually</em>

 <em> //main body to obtain the desired output starts below</em>

<em>   //each 'division' is used to allocate the correct value at the correct </em>

<em>   //since prefix is used to get the desired output of ( )    -</em>

  ac = pnumber/10000000;

  prefix = (pnumber/10000)%1000;

  lnumber = pnumber%10000;

 <em> //main body ends here</em>

  cout<<"Based on your 10-digit number"<<endl;

  cout<<"below you have (AreaCode), Prefix, and - line number "<<endl;

  cout<<"("<<ac<<")"<<""<<prefix<<"-"<<lnumber<<endl;

 <em> //Prints on screen the desired output of the long 10 digit Number</em>

  return 0;<em> //ends program</em>

}

-------------------------------------------------------------------------------------------------------

<em>The Output Sample:</em>

Enter a 10-digit Phone Number:

8019004673

Based on your 10-digit number

below you have (Area Code), Prefix, and - line number

(801) 900-4673

<em>....Programm finished with exit code 0</em>

8 0
3 years ago
Other questions:
  • What is wrong with this line of python code
    9·1 answer
  • Speed in a given direction is called
    12·2 answers
  • The user does not need to highlight data within an Excel worksheet in order to remove conditional formatting. True or false
    14·1 answer
  • Please help ASAP, will mark brainliest!
    7·1 answer
  • Talia was a scientist whose research compared the birth rates of young
    12·2 answers
  • Write an if statement that prints the message ""The number is not valid"" if the variable distance is outside the range 100 thr
    8·1 answer
  • Write a program that will input miles traveled and hours spent in travel. The program will determine miles per hour. This calcul
    5·1 answer
  • Decimal numbers is equivalent to binary 110
    5·1 answer
  • Which are options in the Form Tools Format tab?
    10·1 answer
  • What is the best use of network in homes
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!