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
Amiraneli [1.4K]
3 years ago
5

write an algorithm that gets the price for item A plus the quantity purchased. The algorithm prints the total cost, including a

6% sales tax.
Computers and Technology
1 answer:
I am Lyosha [343]3 years ago
4 0

Answer:

<u>Algorithm() </u>

1. p = Enter the price of item A.

2. c = Enter the number of A’s purchased.

3. Now the price per item with tax is:

              t= p+(p*6/100)

4. The total cost of c items:  

             ct= t * c.

5. Print ct.

In this algorithm, we are taking the price per item and counting it’s cost including tax. Then we are multiplying the price per item with tax with the number of items we purchase, to find the overall cost with tax.

You may calculate the overall cost without tax as (p*c). Then you can find the overall cost with tax as ((p*c)+(p*c*6/100)), as in both way, we will get the same result.

You might be interested in
The fiber-optic cables that span the globe over land and under sea make up the internet _____.
mestny [16]
Faster and cheaper!!!!!!!!!!!!!!!
5 0
3 years ago
Define<br>operating System<br>with some examples​
Andrew [12]

Answer:

An operating system is system software that manages computer hardware, software resources, and provides common services for computer programs

EXAMPLES:  Microsoft Windows, Apple macOS, Linux, Android and Apple's iOS.

Explanation:

7 0
3 years ago
Moon Questions? (diagram attached)
Radda [10]
1). The waxing gibbous phase represents the portion of the cycle of phases
during which the moon appears more than half but less than fully lit, and is growing
as time goes on. In the picture, it's everything from position-3 to position-5. It's
one fourth of the entire cycle, which is 7.4 days, so you'd see it on 7 or 8 consecutive
nights.
(The complete cycle of phases is 29.53 days.)

2). The complete cycle of phases is 29.53 days. Any phase visible on December 21
is visible again on January 19 or January 20.

3). From position-8 to position-5 in the picture is 5/8 of all the way around.
(5/8) of (29.53) = 18.5 days.

4). The locations of high- and low-tides on the Earth are influenced by the position
of the moon and the rotation of the Earth.

5). A lunar eclipse is the result of the moon sailing into the Earth's shadow.
The Earth's shadow is out behind it, opposite to the sun, toward position-5
in the picture, not position-4.
6 0
3 years ago
In this exercise, you will create a couple of helper methods for ArrayLists in a class called ArrayListMethods.
nata0808 [166]

Answer:

package lab1;

import java.util.ArrayList;

import java.util.Iterator;

public class ArrayListMethodsTester

{

public static void main(String[] args)

{

ArrayList<String> stringArray = new ArrayList<String>();

stringArray.add("This");

stringArray.add("is");

stringArray.add("an");

stringArray.add("ArrayList");

stringArray.add("of");

stringArray.add("Strings");

System.out.println("Printing the arraylist:");

ArrayListMethods.print(stringArray);

System.out.println("\nArrayList is condensing:");

ArrayListMethods.condense(stringArray);

ArrayListMethods.print(stringArray);

System.out.println("\nArrayList is duplicating:");

ArrayListMethods.duplicate(stringArray);

ArrayListMethods.print(stringArray);

}

}

class ArrayListMethods

{

static void print(ArrayList stringArray)

{

  Iterator it = stringArray.iterator();

  while (it.hasNext())

     System.out.println(it.next() + " ");

     

}

static void condense(ArrayList stringArray)

{

  int length=stringArray.size();

     

  ArrayList cloneArray=(ArrayList) stringArray.clone();

     

  stringArray.clear();

  StringBuilder sb=new StringBuilder("");

     

  for (int i = 0; i < (length/2); i++)

  {

      sb.append(cloneArray.get(i));

      sb.append(" ");    

  }

  stringArray.add(sb);

     

  StringBuilder sb1=new StringBuilder("");

  for (int i = (length/2); i < length; i++)

  {

      sb1.append(cloneArray.get(i));

      sb1.append(" ");    

  }

  stringArray.add(sb1);

  }

static void duplicate(ArrayList stringArray)

{

  for (int i = 0; i < stringArray.size(); i+=2)

  {

      stringArray.add(i+1,stringArray.get(i));

  }

}

}

Explanation:

  • Get the length of the arraylist  to copy the array into another arraylist .
  • Empty the array so that new content can be stored in it .
  • Use a loop to half of array_list.
  • Use a loop from half of array_list to the end of arraylist and  append all into a single string.
5 0
4 years ago
A company has deployed four 48-port access layer switches to a switch block. For redundancy each access layer switch will connec
NISA [10]

Answer:

The answer is "176".

Explanation:

In the given question there is a total of 192 switch ports, which are available for the 48-port switches. And for four access points, 8 trunk links that are 2 per access layer switch will be required. In every connexion of the trunk include two significantly modified-ports on the circuits throughout the access layer. With trunk connexions to both the communication network controller switches, a total of 17 switcher ports is required, allowing 176 access points for end system connectors.

3 0
3 years ago
Other questions:
  • NEED DONE ASAP Which option in the Insert Table dialog box should you check if you want smaller tables to fit on a single page?
    7·2 answers
  • What is a fax machine used for
    9·1 answer
  • Anthony is responsible for tuning his organization's intrusion detection system. He notices that the system reports an intrusion
    8·1 answer
  • "What is the difference between dialogue and debate?
    7·1 answer
  • Complete the statement below with the correct term.
    5·1 answer
  • A type of multiprocessor chip that provides two or more separate and independent CPUs.
    8·1 answer
  • .9 What is Artificial Intelligence?
    5·1 answer
  • In his digital portfolio, Ben wants to locate each work he created. Where can he list details about the work in his digital port
    7·2 answers
  • Which Packet Tracer feature do you think will be most helpful for you in learning how to manage a network
    5·1 answer
  • Rachel wants to minimize project risks. Arrange the steps in an order that will correctly help Rachel and her team to minimize p
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!