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
marin [14]
3 years ago
8

Write a program that will ask the user to enter the amount of a purchase. The program should then compute the state and county s

ales tax. Assume the state sales tax is 5 percent and the county sales tax is 2.5 percent. The program should display the amount of the purchase, the state sales tax, the county sales tax, the total sales tax, and the total of the sale (which is the sum of the amount of purchase plus the total sales tax). Hint: Use the value 0.025 to represent 2.5 percent, and 0.05 to represent 5 percent. Miles-per-Gallon
Computers and Technology
1 answer:
iVinArrow [24]3 years ago
7 0

Answer:

purchase_amount = float(input("Enter the amount of a purchase: "))

state_sales_tax = purchase_amount * 0.05

country_sales_tax = purchase_amount * 0.025

print("The amount of the purchase is " + str(purchase_amount))

print("The state sales tax is " + str(state_sales_tax))

print("The county sales tax is " + str(country_sales_tax))

print("The total sales tax is " + str(state_sales_tax + country_sales_tax))

print("The total of the sale is " + str(purchase_amount + state_sales_tax + country_sales_tax))

Explanation:

*The code is in Python.

Ask the user to enter purchase amount

Calculate the state sales tax, multiply purchase amount by 0.05

Calculate the county sales tax, multiply purchase amount by 0.025

Calculate the total sales tax, sum the state sales tax and county sales tax

Print the amount of the purchase, state sales tax, county sales tax, total sales tax and  total of the sale

You might be interested in
Write a procedure named Str_find that searches for the first matching occurrence of a source string inside a target string and r
kirill115 [55]

Answer: Provided in the explanation section

Explanation:

Str_find PROTO, pTarget:PTR BYTE, pSource:PTR BYTE

.data

target BYTE "01ABAAAAAABABCC45ABC9012",0

source BYTE "AAABA",0

str1 BYTE "Source string found at position ",0

str2 BYTE " in Target string (counting from zero).",0Ah,0Ah,0Dh,0

str3 BYTE "Unable to find Source string in Target string.",0Ah,0Ah,0Dh,0

stop DWORD ?

lenTarget DWORD ?

lenSource DWORD ?

position DWORD ?

.code

main PROC

  INVOKE Str_find,ADDR target, ADDR source

  mov position,eax

  jz wasfound           ; ZF=1 indicates string found

  mov edx,OFFSET str3   ; string not found

  call WriteString

  jmp   quit

wasfound:                   ; display message

  mov edx,OFFSET str1

  call WriteString

  mov eax,position       ; write position value

  call WriteDec

  mov edx,OFFSET str2

  call WriteString

quit:

  exit

main ENDP

;--------------------------------------------------------

Str_find PROC, pTarget:PTR BYTE, ;PTR to Target string

pSource:PTR BYTE ;PTR to Source string

;

; Searches for the first matching occurrence of a source

; string inside a target string.

; Receives: pointer to the source string and a pointer

;    to the target string.

; Returns: If a match is found, ZF=1 and EAX points to

; the offset of the match in the target string.

; IF ZF=0, no match was found.

;--------------------------------------------------------

  INVOKE Str_length,pTarget   ; get length of target

  mov lenTarget,eax

  INVOKE Str_length,pSource   ; get length of source

  mov lenSource,eax

  mov edi,OFFSET target       ; point to target

  mov esi,OFFSET source       ; point to source

; Compute place in target to stop search

  mov eax,edi    ; stop = (offset target)

  add eax,lenTarget    ; + (length of target)

  sub eax,lenSource    ; - (length of source)

  inc eax    ; + 1

  mov stop,eax           ; save the stopping position

; Compare source string to current target

  cld

  mov ecx,lenSource    ; length of source string

L1:

  pushad

  repe cmpsb           ; compare all bytes

  popad

  je found           ; if found, exit now

  inc edi               ; move to next target position

  cmp edi,stop           ; has EDI reached stop position?

  jae notfound           ; yes: exit

  jmp L1               ; not: continue loop

notfound:                   ; string not found

  or eax,1           ; ZF=0 indicates failure

  jmp done

found:                   ; string found

  mov eax,edi           ; compute position in target of find

  sub eax,pTarget

  cmp eax,eax    ; ZF=1 indicates success

done:

  ret

Str_find ENDP

END main

cheers i hoped this helped !!

6 0
3 years ago
These factors limit the ability to attach files to e-mail messages. location of sender recipient's ability to open file size of
NeX [460]

The answer is

Recipient's ability to open file

Size of file

Sometimes, it might occur that the email message attachment you’ve sent to someone has an error or is corrupt and thus, limits the recipient ability to open the file. Another factor is the size of the file. All email servers limit the size of the file attached in an email that a recipient can receive mainly because of security reasons. Google Mail, for instance, only allows you to send 25MB only. This might limit the ability to attach files to e-mail messages as well.

3 0
2 years ago
Read 2 more answers
Plz help asap <br> I'm giving 20 points to whoever answers it right
yKpoI14uk [10]

Answer:

A pneumatic system is a system that uses compressed air to transmit and control energy. Pneumatic systems are used extensively in various industries. Most pneumatic systems rely on a constant supply of compressed air to make them work. This is provided by an air compressor.

A hydraulic system is a drive technology where a fluid is used to move the energy from e.g. an electric motor to an actuator, such as a hydraulic cylinder. The fluid is theoretically uncompressible and the fluid path can be flexible in the same way as an electric cable.

Explanation:

<h3>Examples of pneumatic systems and components </h3><h3>Air brakes on buses and trucks. </h3><h3>Air brakes on trains. </h3><h3>Air compressors. </h3><h3>Air engines for pneumatically powered vehicles. </h3><h3>Barostat systems used in Neurogastroenterology and for researching electricity. </h3><h3>Cable jetting, a way to install cables in ducts. </h3><h3>Dental drill.</h3>

<h3>Hydraulic systems use the pump to push hydraulic fluid through the system to create fluid power. The fluid passes through the valves and flows to the cylinder where the hydraulic energy converts back into mechanical energy. The valves help to direct the flow of the liquid and relieve pressure when needed.</h3>
7 0
2 years ago
Create a conditional expression that evaluates to string "negative" if userVal is less than 0, and "non-negative" otherwise. Ex:
Goryan [66]

Answer:

PROGRAMMING APPROACH:

  • Define the necessary header file using namespace.
  • Define the main() method.
  • Declare variable inside the function().
  • Print result.

Explanation:

Required C++ Code:

#include<iostream>

#include<string>

using namespace std;

int main()

{

  string condStr;

  int userVal;

  cin>>userVal;

  condStr=(userVal<0)?("negative"):("non-negative");

  cout<<userVal<< " is "<< condStr <<"."<<endl;

}

OUTPUT:

-2

-2 is negative.

5 0
3 years ago
Advantages and disadvantages of Computer and Information Systems Manager
ser-zykov [4K]

Answer:

Well the first advantage is they get paid very well with $115,000 a year in 2015. Which is projected to increase in the next 10 years. Having experience in this career will give you many options for other careers like this. This is not the job you would want if you plan on wanting to work with other people with this job you are a one man job.

Explanation:

3 0
3 years ago
Other questions:
  • Wordwrap forces you to stop typing words and press the enter key at the end of each line.
    12·1 answer
  • A technology company only hires applicants who are under the age of 30. This company could face possibly _________ consequences
    9·2 answers
  • Explain the steps users can take to maintain an operating system
    15·1 answer
  • Will the Python code below print something? And will it terminate?
    9·1 answer
  • Declare a variable temperature and initialize it to 98.6. Instructor Notes: Note that "initialize" means "declare and assign a v
    5·1 answer
  • Abby has always dreamed of having her own ice cream shop. Now as a young entrepreneur she has decided to pursue her dream, but s
    13·1 answer
  • Explain any two features of a computer​
    15·1 answer
  • Type the correct answer in the box. Spell all words correctly.
    11·1 answer
  • In how many ways can a list of students names from your class be organized?​
    14·1 answer
  • What's the difference between an operating system and an application software?​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!