Write a C++ program which accepts the quantity of a product purchased and prints the amount to be paid by the customer.​

Answers

Answer 1
Answer:

Answer:

firstly the exel program is very useful to costumer or to calculate by Microsoft. People use it to company or office. It works for make good commination


Related Questions

Jeff types a sentence She wore a new dress yesterday. He erroneously typed w instead of e in the word dress. What is the accuracy of the typed sentence?
CHALLENGE 7.1.1: Initialize a list. ACTIVITY Initialize the list short.names with strings 'Gus', Bob, and 'Ann'. Sample output for the given program Gus Bob Ann 1 short_names- Your solution goes here 2 # print names 4 print(short_names[0]) 5 print(short names [11) 6 print(short_names[2])
PLEASE HURRY!!!Look at the picture below and please help.
in C, Print the two strings, firstString and secondString, in alphabetical order. Assume the strings are lowercase. End with newline. Sample output: capes rabbits
Whichof following can be thrown using the throw statement?ErrorThrowableExceptionRuntimeExceptionAll of Given

the UDP server described needed only one socket, whereas the TCP server needed two sockets. Why? If the TCP server were to support n simultaneous connections, each from a different client host, how many sockets would the TCP server need?

Answers

Answer:

The UDP server described needed only one socket, whereas the TCP server needed two sockets because:

  • With the UDP server, there is no welcoming socket, and all data from different clients enters the server through this one socket.
  • With the TCP server, there is a welcoming socket, and each time a client initiates a connection to the server, a new socket is created. Thus, to support n simultaneous connections, the server would need n+1 sockets.

Answer:

UDP uses one socket and TCP requires two sockets in a transmission because UDP is a way one connectionless protocol but TCP is connection oriented.

The TCP server that supports n simultaneous connections would require n sockets, ranging from 1 through n.

Explanation:

A socket is a fusion of a port number and a source IP address using a colon.

UDP is a transport layer protocol that is unreliable, because it does not need to establish connection to transmit packets and does not retransmit dropped packets. TCP is another transport layer protocol that is reliable, establish connection and retransmit dropped packets.

For a UDP, only one socket would be created to transmission. A socket on the client side and server side would be created in TCP connection. A server can have multiple sockets for one or different transmission protocols.

A vowel word is a word that contains every vowel. Some examples of vowel words are sequoia, facetious, and dialogue. Determine if a word input by the user is a vowel word.

Answers

Answer:

vowels = ("a", "e", "i", "o", "u")

word = input("Enter a word: ")

is_all = True

for c in vowels:

   if c not in word:

       is_all = False

if is_all == True:

   print(word + " is a vowel word.")

else:

   print(word + " is not a vowel word.")

Explanation:

Initialize a tuple, vowels, containing every vowel

Ask the user to enter a word

Initially, set the is_all as True. This will be used to check, if every vowel is in word or not.

Create a for loop that iterates through the vowels. Inside the loop, check if each vowel is in the word or not. If one of the vowel is not in the vowels, set the is_all as False.

When the loop is done, check the is_all. If it is True, the word is a vowel word. Otherwise, it is not a vowel word.

I'm stuck on this Java exercise problem and don't know how to organize my code with proper formatting and it's not helping that I'm pretty terrible at logic. I can't figure out how to return the number of spaces to be displayed in the main method.

Answers

In your "count spaces method" before the for loop, you want to declare an int variable (let's call it spc)

then, each time you find that charat, spc++.


also, the string must be declared in the main method, not the spaces count method.


The actual code:


public class CountSpaces{

public static void main(String[] args){

String instring = "(your quote here)";

int spaces = calculateSpaces(instring);

System.out.println("The number of spaces is " + spaces);

}

public static int calculateSpaces(String in){

int spc = 0;

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

if(in.charAt(i)== ' '){

spc++;

}

}

return spc;

}

}


that should be it.  If you have any questions, feel free to reach out.

A computer processor stores numbers using a base of: _____.a) 2b) 10c) 8d) 16

Answers

A computer processor stores numbers using a base of 16. The correct option is d).

What is a computer processor?

A computer processor is a computer processing unit that is a CPU. CPU controls all the functions of the computer. It stores memory, and it has two types of memory. Short-term and long-term. It executes all the instructions given to the computer.

The design expert discusses the project three-dimensionally at this point in the process. To define the character of the finished project and an ideal fulfillment of the project program, a variety of potential design concepts are investigated.

The different kinds of computer processors are: microprocessor, microcontroller, embedded processor, digital signal processor

Therefore, the correct option is d). 16.

To learn more about computer processors, refer to the link:

brainly.com/question/15102947

#SPJ5

It stores a base of 16

Write a program to provide information on the height of a ball thrown straight up into the air. The program should request as input the initial height, h feet, and the initial velocity, v feet per second. The height of the ball after t seconds is

Answers

Answer:

The height of the ball after t seconds is h + vt - 16t 2 feet:

def main():

getInput()

def getInput():

h = int(input("Enter the initial height of the ball: ")) # Adding the int keyword before input() function

v = int(input("Enter the initial velocity of the ball: ")) # Same as above

isValid(h,v)

def isValid(h,v):

if ((h <= 0) or (v <= 0)):

print("Please enter positive values")

getInput()

else:

maxHeight(h,v)

def maxHeight(h,v):

t = (v/32)

maxH = (h + (v*h) - (16*t*t))

print ("\nMax Height of the Ball is: " + str(maxH) + " feet")

ballTime(h, v)

def ballTime(h,v):

t = 0

ballHeight = (h + (v*t) - (16*t*t))

while (ballHeight >= 0):

t += 0.1

ballHeight = (h + (v*t) - (16*t*t))

print ("\nThe ball will hit the ground approximately after " + str(t) + " seconds")

# Driver Code

main()

Answer:

I am writing a python code.

def getInput():

   h = int(input("enter the height: "))

   v = int(input("enter the velocity: "))

   isValid(h,v)    

def isValid(h,v):

   if (h<= 0 or v<=0):

       print("not positive ")            

   else:

       height = maximumHeight(h,v)

       print("maximum height of the ball is", height," ft.")

       balltime = ground_time(h,v)

       print("The ball will hit the ground after", balltime, "s approximately.")

def maximumHeight(h,v):

   t = (v/32)

   maxheight = (h + (v*t) - (16*t*t))

   return maxheight    

def ground_time(h,v):

   t = 0.1

   while(True):

       heightofball = (h + (v*t) - (16*t*t))

       if (heightofball <= 0):

           break

       else:

           t += 0.1  

   return t

Explanation:

There are four functions in this program.

getInput() function is used to take input from the user which is height and velocity. h holds  the value of height and v holds the value of velocity. input() function is used to accept values from the user.

isValid() function is called after the user enters the value of height and velocity. This function first checks if the value of height and velocity is less than 0. If it is true the message not positive is displayed. If its false then maximumHeight() is called which returns the maximum height of the ball and function ground_time() is called to return the time when the ball will hit the ground.

maximumHeight() function first divides the value of velocity with 32 as the ball will reach its maximum  height after v/32 seconds. It then returns the maximum height by using the formula:  heightofball = (h + (v*t) - (16*t*t)).

ground_time() calculates the time the ball takes to reach the ground. There is a while loop to height after every 0.1 second and determine when the height is no longer a positive. It uses (h + (v*t) - (16*t*t)) formula to calculate the height and when the value of height gets less than or equal to 0 the loop terminates otherwise it keeps calculating the height while adding 1 to the value of t at each iteration. After the loop breaks, it returns the value of t.

To see the output of the maximum height and time taken by ball to reach the ground, you can call the getInput() function at the end of the above program as:

getInput()

Output:

enter the height: 9

enter the velocity: 10

maximum height of the ball is 10.6525  ft.

the ball will hit the ground after 1.2 s approximately.

6 things you should consider when planning a PowerPoint Presentation.

Answers

Answer: I would suggest you consider your audience and how you can connect to them. Is your presentation, well, presentable? Is whatever you're presenting reliable and true? Also, no more than 6 lines on each slide. Use colors that contrast and compliment. Images, use images. That pulls whoever you are presenting to more into your presentation.

Explanation: