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
labwork [276]
3 years ago
15

Read the following program requirements prior to completing the Hands-on. A retail company must file a monthly sales tax report

listing the total sales for the month and the amount of state and county sales tax collected. The state sales tax rate is 4 percent and the county sales tax rate is 2 percent. Write a program that asks the user to enter the total sales for the month. The application should calculate and display the following: • The amount of county sales tax • The amount of state sales tax • The total sales tax (county plus state) Step 1: Write the steps the algorithm:
Computers and Technology
1 answer:
Licemer1 [7]3 years ago
8 0

Answer:

state_sales_tax_rate = 0.04

county_sales_tax_rate = 0.02

sales = float(input("Enter the total sales for the month: "))

county_sales_tax = sales * county_sales_tax_rate

state_sales_tax = sales * state_sales_tax_rate

total_sales_tax = county_sales_tax + state_sales_tax

print("The amount of county sales tax is " + str(county_sales_tax))

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

print("The total sales tax is " + str(total_sales_tax))

Explanation:

*The code is in Python.

Set the  state_sales_tax_rate and county_sales_tax_rate

Ask the user to enter the sales

Calculate the county_sales_tax, multiply sales by county_sales_tax_rate

Calculate the state_sales_tax, multiply sales by state_sales_tax_rate

Calculate the total_sales_tax, sum county_sales_tax and state_sales_tax

Print the results

You might be interested in
Write a program whose input is a character and a string, and whose output indicates the number of times the character appears in
Zina [86]

Answer:

Here is the C++ program:

#include <iostream> // to include input output functions

using namespace std; // to identify objects like cin cout

int counter(string userString, char character) { //function counter

   int count = 0;   // counts the no of times a character appears in the string

   for (int i=0;i<userString.length();i++)  

// loop to move through the string to find the occurrence of the character

       if (userString[i] == character) //if characters is found in the string

           count++;   //counts the occurrence of the character in the string

   return count; }   //returns the no of times character occurs in the string

int main() { //start of the main() function body

   string s; // stores the string entered by the user

   cout<<"Enter a string: "; //prompts user to enter the string

   cin>>s; //reads the string from user

   char ch; //stores the character entered by the user

   cout<<"Enter a character: "; //prompts user to enter a character

   cin>>ch; //reads the character from user

   cout << counter(s, ch) << endl; }  

//calls counter function to find the number of times a character occurs in the //string

Explanation:

The counter function works as following:

It has a count variable which stores the number of occurrences of a character in the userString.

It uses a for loop which loops through the entire string.

It has i position variable which starts with the first character of the string and checks if the first character of userString matches with the required character.

If it matches the character then count variable counts the first occurrence of the character and in the userString and is incremented to 1.

If the character does not match with the first character of the userString then the loops keeps traversing through the userString until the end of the userString is reached which is specified by the length() function which returns the length of the string.

After the loop ends the return count statement is used to return the number of occurrences of the character in the userString.

The main() function prompts the user to enter a string and a character. It then calls counter() function passing string s and character ch arguments to it in order to get the number of times ch appears in s.

The output is attached in a screenshot.

6 0
4 years ago
Can u please help me solve this
azamat

Alice has twice as many pencils as Cara. Leon has three more pencils than Alice. The three children have a total of 58 pencils.

<h3>What are the no. of pencils?</h3>

The no. of pencils are there totally as the 11.

Read more about the basic maths:

brainly.com/question/19493296

#SPJ1

4 0
2 years ago
Collaborative filtering is
vazorg [7]

Answer:

A: used by ISP's to filter out email SPAM

C: a way to help an individual focus on best choices when deciding what to watch or buy.

Explanation:

Collaborative filtering uses a community-based approach to filter spam. It works by collecting numerous email users from around the world. By doing this, it becomes possible for users to flag emails that are spam and those that are legitimate.

Also Collaborative Filtering is one of the most efficient techniques for building a system that can help a user when it comes to recommending best choices based on information from a large number of users.

4 0
4 years ago
Ms Access is spreadsheet software.True or false​
Doss [256]

Answer: I'd say false.

Explanation: An example of a spreadsheet software would be MS Excel. Access does have an option to create a spreadsheet but it also has other uses.

6 0
3 years ago
Read 2 more answers
What are the steps to configure user information in a document?
chubhunter [2.5K]

Answer:

file, properties, options, general

Explanation:

4 0
3 years ago
Read 2 more answers
Other questions:
  • 48. What is another word for processor?
    7·1 answer
  • Assume that the following code exists inside a method of MyClass, and that this code compiles without errors: int result = book.
    13·1 answer
  • Samuel is working on decimal and binary conversion for his college project. He is using the binary number 111011 and wants to ex
    10·2 answers
  • Which of the following function headings arevalid? If they are invalid, explain why.
    12·1 answer
  • Is it possible to make teleportation with a fusion device
    15·1 answer
  • Why do we need vram​
    6·1 answer
  • A technician is configuring a new SOHO multifunction wireless router at a customer’s location to provide network access to sever
    12·1 answer
  • What is mendix about?
    10·1 answer
  • Write only in C, not C++.
    14·1 answer
  • An acceptable website design is one that meets
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!