write a basic program to calculate the area of a circle​

Answers

Answer 1

Answer: int main() {

float radius, area;

printf("\nEnter the radius of Circle : ");

scanf("%d", &radius);

area = 3.14 * radius * radius;

printf("\nArea of Circle : %f", area);

return (0);

Explanation:


Related Questions

Types of Selective Enforcement?​

Answers

Answer:

In law, selective enforcement occurs when government officials (such as police officers, prosecutors, or regulators) exercise discretion, which is the power to choose whether or how to punish a person who has violated the law. The biased use of enforcement discretion, such as that based on racial prejudice or corruption, is usually considered a legal abuse and a threat to the rule of law.

In some cases, selective enforcement may be desirable.[1] For example, a verbal warning to a teenager may effectively alter their behavior without resorting to legal punishment and with the added benefit of reducing governmental legal costs. In other cases, selective enforcement may be inevitable. For example, it may be impractical for police officers to issue traffic tickets to every driver they observe exceeding the speed limit, so they may have no choice but to limit action to the most flagrant examples of reckless driving. Therefore, the mere fact that a law is selectively enforced against one person and not against another, absent bias or pattern of enforcement against a constitutionally-protected class, is not illegal.

Take the Class B address 172.16.0.0 and answer the following questions by typing those answers at the end of each question:

What is the default subnet mask of a Class B IPv4 address?
255.255.0.0
What is the first usable IP address of this “not-subnetted” network?

What is the last usable IP address of this “not-subnetted” network?

What is the broadcast address of this “not-subnetted” network?

How many total hosts are allowed on this “not-subnetted” network?

Let’s split this network into 4 subnets

What is the new subnet mask?

What is the first subnet address of your newly subnetted address?

What is the first usable IP address of your newly subnetted address?

What is the last usable IP address of your newly subnetted address?

What is the broadcast address of your newly subnetted address?

How many usable hosts are on this subnet?

Fill in the following information for the second, third, and fourth new subnets:

Network (subnet) address
Usable host range
Broadcast





















Take the Class A address 10.0.0.0 and answer the following questions by typing those answers at the end of each question:

What is the default subnet mask of a Class A IPv4 address?
255.0.0.0
What is the first usable IP address of this “not-subnetted” network?

What is the last usable IP address of this “not-subnetted” network?

What is the broadcast address of this “not-subnetted” network?

How many total hosts are allowed on this “not-subnetted” network?

Let’s split this network into 4 subnets

What is the new subnet mask?

What is the first subnet address of your newly subnetted address?

What is the first usable IP address of your newly subnetted address?

What is the last usable IP address of your newly subnetted address?

What is the broadcast address of your newly subnetted address?

How many usable hosts are on this subnet?

Fill in the following information for the second, third, and fourth new subnets:

Network (subnet) address
Usable host range
Broadcast

Answers

Explanation:

For the Class B address 172.16.0.0:

What is the default subnet mask of a Class B IPv4 address?

255.255.0.0

What is the first usable IP address of this “not-subnetted” network?

172.16.0.1

What is the last usable IP address of this “not-subnetted” network?

172.16.255.254

What is the broadcast address of this “not-subnetted” network?

172.16.255.255

How many total hosts are allowed on this “not-subnetted” network?

65,534

Let’s split this network into 4 subnets

What is the new subnet mask?

255.255.192.0

What is the first subnet address of your newly subnetted address?

172.16.0.0

What is the first usable IP address of your newly subnetted address?

172.16.0.1

What is the last usable IP address of your newly subnetted address?

172.16.63.254

What is the broadcast address of your newly subnetted address?

172.16.63.255

How many usable hosts are on this subnet?

16,382

For the second subnet:

Network (subnet) address: 172.16.64.0

Usable host range: 172.16.64.1 - 172.16.127.254

Broadcast: 172.16.127.255

For the third subnet:

Network (subnet) address: 172.16.128.0

Usable host range: 172.16.128.1 - 172.16.191.254

Broadcast: 172.16.191.255

For the fourth subnet:

Network (subnet) address: 172.16.192.0

Usable host range: 172.16.192.1 - 172.16.255.254

Broadcast: 172.16.255.255

The following information for the second, third, and fourth new subnets are:

Second subnet:

Network (subnet) address: 172.16.64.0

Usable host range: 172.16.64.1 - 172.16.127.254

Broadcast: 172.16.127.255

What is subnets?

Subnets are a way of dividing a computer network into separate, smaller networks. It allows an organization to create multiple logical networks within a single physical network. Subnets allow for better security, control, and performance. Each subnet has its own network address and a range of IP addresses that can be used for hosts. All hosts within a subnet can communicate directly with each other without the need for a router. Subnets also allow organizations to segment their network into different levels of access and security. This helps to prevent unauthorized access to sensitive information or resources.

Third subnet:

Network (subnet) address: 172.16.128.0

Usable host range: 172.16.128.1 - 172.16.191.254

Broadcast: 172.16.191.255

Fourth subnet:

Network (subnet) address: 172.16.192.0

Usable host range: 172.16.192.1 - 172.16.255.254

Broadcast: 172.16.255.255

To learn more about subnets

https://brainly.com/question/29039092

#SPJ1

I need answer to question 4a, b and c
Thank you

Answers

A. Adding one processor will typically result in a significant reduction in processing time.

What is processor?

A processor is a type of computer hardware that acts as the central processing unit (CPU) of a computer system. It is responsible for carrying out instructions from a program and for controlling the operation of other components in a computer. The processor is responsible for executing the instructions of a computer program and managing the transfer of data between different hardware components. It is also responsible for controlling the operation of other components such as memory, input/output devices and the operating system of the computer.

b. Adding 240 more processors will result in a smaller reduction in processing time than adding the first processor.

c. The number of processors worth having for this problem will depend on the complexity of the task and the resources available. It is generally recommended to use the most efficient number of processors required to complete the task in a timely manner.

To learn more about processor

https://brainly.com/question/614196

#SPJ1

Draw a state process model with two (2) suspend states and fully discuss the
transition of processes from one state to the next by OS

Answers

Answer:

asan yong pic

Explanation:

pic po asan

Discuss in details the difference among programmed I/O, Interrupt Driven I/O
and Direct Memory access over the processor

Answers

Answer:

Programmed I/O, Interrupt Driven I/O, and Direct Memory Access (DMA) are three methods of transferring data between input/output (I/O) devices and the central processing unit (CPU) of a computer system.

Programmed I/O:

In programmed I/O, the CPU executes instructions to transfer data between the I/O device and memory. The CPU continuously polls the I/O device to check if it is ready to send or receive data. This method is simple and easy to implement, but it is also inefficient since the CPU has to wait for the I/O device to be ready before it can perform any other task.

Interrupt Driven I/O:

In interrupt-driven I/O, the CPU sends a command to the I/O device to start the data transfer, and then continues to perform other tasks. When the I/O device has completed the data transfer, it interrupts the CPU to signal that the data is ready. The CPU then stops its current task and processes the interrupt by executing an interrupt service routine (ISR) to transfer the data between the I/O device and memory. This method is more efficient than programmed I/O since the CPU can perform other tasks while waiting for the I/O device to complete the data transfer.

Direct Memory Access (DMA):

In Direct Memory Access (DMA), the I/O device can access the system memory directly without the intervention of the CPU. The I/O device sends a request to the DMA controller to initiate the data transfer, and the DMA controller transfers the data between the I/O device and memory without any involvement of the CPU. The CPU can continue to perform other tasks while the DMA controller performs the data transfer. This method is the most efficient of the three since it frees up the CPU to perform other tasks while the data transfer is being performed.

In summary, the main differences among programmed I/O, interrupt-driven I/O, and DMA are:

Programmed I/O is the simplest method of data transfer, but it is also the least efficient since the CPU has to continuously poll the I/O device to transfer data.

Interrupt-driven I/O is more efficient than programmed I/O since the CPU can perform other tasks while waiting for the I/O device to complete the data transfer.

DMA is the most efficient method of data transfer since it frees up the CPU to perform other tasks while the DMA controller performs the data transfer directly between the I/O device and memory.

can anyone help?


what are the arguments of the function?


Answer choices are
1. Mystery
2. 1
3. 4,8,3
or
4. a,b,c

Answers

4, 8, 3 are the arguments of the given code

What are the arguments?

Those are the values that are passed into the function and are represented as parameters.

According to the given Javascript code,

The first condition (a < b && b < c) is not true, as 8 is not less than 3.The second condition (b < a && a < c) is not true, as 8 is not less than 4.The third condition (c < a && c < b) is true, as 3 is less than both 4 and 8.

If we look at what values are passed in where the function is called. In this case, it gets called in the purple block (console.log). 4, 8, 3 are the arguments of the given code and this is the answer to the given question

Read more about javascript here:

https://brainly.com/question/28021308

#SPJ1

Write the definition of a public class Player containing:
An instance variable name of type String, initialized to the empty String.
An instance variable score of type int, initialized to zero.
A method called setName that has one parameter, whose value it assigns to the instance variable name.
A method called setScore that has one parameter, whose value it assigns to the instance variable score.
A method called getName that has no parameters and that returns the value of the instance variable name.
A method called getScore that has no parameters and that returns the value of the instance variable score.
No constructor need be defined.

Answers

Here's the definitiοn οf the Player class as per the requirements:

public class Player

{

  // Instance variables

  private string name = "";

  private int scοre = 0;

  // Methοds

  public vοid setName(string playerName)

  {

      name = playerName;

  }

  public vοid setScοre(int playerScοre)

  {

      scοre = playerScοre;

  }

  public string getName()

  {

      return name;

  }

  public int getScοre()

  {

      return scοre;

  }

}

This class cοntains twο instance variables (name and scοre) and fοur methοds (setName(), setScοre(), getName(), and getScοre()). The setName() and setScοre() methοds assign a value tο the cοrrespοnding instance variable. The getName() and getScοre() methοds return the value οf the cοrrespοnding instance variable. There is nο cοnstructοr defined, sο the class will use the default cοnstructοr.

What is a variable?  

A variable is a named stοrage lοcatiοn in cοmputer memοry that hοlds a value οr reference. It can be mοdified οr accessed during prοgram executiοn.

A cοnstructοr is a special methοd οf a class that is used tο create and initialize οbjects οf that class.

To know more about variable, visit:

brainly.com/question/17344045

#SPJ9

Create a list of 5 characters from your favorite game. Ask the user to enter their favorite character's name. If it is not present in the list tell the user that This character is not present in my list of favorites and ask the user whether they would like to add it. If the user says Yes, show them the list and ask at which position they would like to add it. Add the character's name at the respective position. If they would not like to add it then print Thank You for telling me your favorite character. If the name already exists then display a message saying Yay, one of our favorite character match.

this is a python question. So copy-paste your answer directly from the python app.
If you give me a good answer, you'll get 100 points :)

Answers

Answer:

# List of favorite characters

favorite_characters = ['Mario', 'Link', 'Donkey Kong', 'Samus', 'Yoshi']

# Ask user to enter their favorite character

fav_character = input("Enter your favorite character: ")

# Check if character is present in list

if fav_character in favorite_characters:

   print("Yay, one of our favorite characters match.")

else:

   add_char = input("This character is not present in my list of favorites. Would you like to add it? (Yes/No): ")

   if add_char.lower() == 'yes':

       print(favorite_characters)

       position = int(input("At which position would you like to add it? "))

       favorite_characters.insert(position-1, fav_character)

       print(f"{fav_character} added at position {position}.\nNew list of favorite characters: {favorite_characters}")

   else:

       print("Thank you for telling me your favorite character.")

Write your own function, named HappyBirthday, which takes 1 (required) integer parameter: year, and one (required) string parameter, name.




Use the year input to calculate the number of years of the person, based on a current year.


If number is less than 1920, print: "Error, need at least 1920 year value"




Example: if the following arguments are passed to your HappyBirthday function:


2000 Larry


Your program should print: "Happy 23 Birthday Larry!"


it seems like i'm on the right path but it's not running. i'm getting syntax errors! I'm also using python!

Answers

Python is a powerful, high-level, general-purpose programming language.

Python script for the  HappyBirthday function

def HappyBirthday(year, name):

 current_year = 2020

 years = current_year - year

 if year < 1920:

   print("Error, need at least 1920 year value")

 else:

   print("Happy", years, "Birthday", name, "!")

HappyBirthday(2000, "Larry")

Python is used for many different types of applications, including web development, data science, scripting, game development, system automation, and more.

Python is an easy-to-learn language that emphasizes readability and simplicity, allowing developers to quickly and efficiently create programs and applications.

Learn more about Python here:

https://brainly.com/question/26497128

#SPJ1

What tool can be used to organize the structure of only the important pages of your website?

You can use a(n)_________ site map to organize the structure of only the important pages of your website.​

Answers

Answer:

You can use a "visual" site map to organize the structure of only the important pages of your website. A visual site map is a diagram or flowchart that provides an overview of the site's structure, including the main sections, subsections, and important pages. It helps to identify the most important pages and how they are connected, allowing you to prioritize content and ensure that the site is easy to navigate.

Explanation:

Lana wants to start a new query by amending an old one. She should
A.) delete any old criteria.
B.) start the criteria with an asterisk.
C.) start the criteria with a question mark.
D.) add new queries to older ones.

Answers

Answer:

delete any old criteria

Draw the ER diagram for the following entities ssume the attributes and relationship yourself supermarket, Customer, Products, Cashier lesman, Security Guard​

Answers

Note that the ER Diagram for the above entities are given in the attached image.

What is the rationale for the response in the attached document?

In this diagram, each entity is represented as a rectangle, and each attribute is represented as an oval connected to the entity. The relationships between entities are represented as lines connecting the rectangles.

There are several relationships between the entities in the diagram:

A customer can buy many products, and a product can be bought by many customers. This is a many-to-many relationship, and it is represented by a diamond shape between the Customer and Product entities.A cashier can sell many products, and a product can be sold by many cashiers. This is also a many-to-many relationship, represented by a diamond shape between the Products and Cashier entities.A Security Guard is not related to any other entity in the diagram but is still included as an entity with its own attributes.

Learn more about ER Diagrams;
https://brainly.com/question/30873853
#SPJ1

Draw a state process model with two (2) suspend states and fully discuss the
transition of processes from one state to the next by OS.

Answers

This process model features two suspend states—Waiting and Suspended—along with three active states—Ready, Running, and Interrupted. There is also a further state known as Zombie.

What two states are there in the two state process model?

A two-state model, which has just the two states listed below, is the simplest model for the process state. Currently running state: A state in which the process is active. A process in the "not running" state is one that is awaiting execution.

Suspended process: what is it?

The operating system suspends one process by putting it in the Suspended state and moving it to disc if a process in main memory enters the blocked state.

To know more about Interrupted visit:-

https://brainly.com/question/29770273

#SPJ1

Assignment 4: Divisible by Three need help pls pls plsss

Answers

Divisibility by three is a basic concept in arithmetic that is important to understand for various mathematical operations.

In order to determine if a number is divisible by three, you can use the rule of threes: add up the digits of the number and if the sum is divisible by three, then the original number is also divisible by three.For example, let's consider the number 453. We add the digits together: 4 + 5 + 3 = 12. Since 12 is divisible by three, we know that 453 is also divisible by three.This rule works for larger numbers as well. For instance, consider the number 6,201. Adding the digits gives us: 6 + 2 + 0 + 1 = 9. Since 9 is divisible by three, we can conclude that 6,201 is also divisible by three.Understanding the concept of divisibility by three is important for various mathematical operations such as long division, fractions, and even algebra.

To learn more about operations click the link below:

brainly.com/question/30651223

#SPJ1

LensForAll is a company that sells affordable contact lenses on its website. The CEO of the company realizes that an app must be developed that would allow customers to virtually try on colored lenses to find out what best suits them. Which of these features should the app have
Hey it should be a portable app so that it is quick to use B it should have responsive design so that it is easy to use on mobile devices see it should be a part of a productivity Suite so uterus can multitask or D is should be a local app so that users are installed​

Answers

The features which the app should have are:

- It should be a web app so that it runs on all devices- It should be a native app so that the device camera can be used by the app- It should have a responsive design so that it is easy to use on mobile devices

What is a Mobile App?

A computer program or software application called a mobile application is made to run on a mobile device, such as a phone, tablet, or watch.

With this in mind, it is stated that the app which must be developed that would allow customers to virtually try on colored lenses to find out what best suits them thus It should be a native app so that the device camera can be used by the app and also have a responsive design so that it is easy to use on mobile devices

Read more about mobile apps here:

https://brainly.com/question/26264955

#SPJ1

What is an application-layer message? A transport-layer segment? A network-layer
datagram? A link-layer frame?

Answers

Answer:

An application-layer message is the data sent between two or more applications. This data can be an email, a voice call, an instant message, a downloadable file, or other type of application-based data. Each application-layer message is divided into one or more packets, which are typically sent via the transport layer of the network.

A transport-layer segment is the packet formed by the Transport layer of the network as it takes the application layer data and transmits it to the Network layer. This packet travels across the network and can be fragmented into multiple segments if it needs to cross a link that has a maximum data size it can handle.

A network-layer datagram is the data unit formed by the Network layer of the network. This datagram is sent to or from the source or destination node and contains information about the route it should take through the network. This layer also performs network-level addressing and routing as the datagram is routed through the network.

A link-layer frame is the smallest data unit sent across a single link in the network. The frame is typically made up of a frame header which contains information about the destination node and link-level addressing and the frame payload which contains the data the link should transport. The frame is then enclosed within a frame check sequence which can be used to detect errors in the frame.

Shifts in production possibilities Suppose the fictional country of Yosemite produces two types of goods: agricultural and capital. The following diagram shows its current production possibilities frontier for sorghum, an agricultural good, and microprocessors, a capital good. Drag the production possibilities frontier (PPF) on the graph to show the effects of a breakout of avian flu that sickens millions of workers. Note: Select either end of the curve on the graph to make the endpoints appear. Then drag one or both endpoints to the desired position. Points will snap into position, so if you try to move a point and it snaps back to its original position, just drag it a little farther.

Answers

The drag the production possibilities frontier (PPF) on the graph to show the effects of a breakout of avian flu that sickens millions of workers would shift the PPF inwards towards the origin.

What is production possibilities frontier (PPF)?

The production possibilities frontier (PPF) is an economic concept that illustrates the maximum amount of output an economy can produce with a given amount of inputs. It is a graphical representation of the combination of two or more products that an economy can produce with the available resources. The PPF depicts the maximum possible production at different levels of inputs and shows the trade-offs between the two products.

This is because the avian flu would reduce the number of workers available to produce the goods, thus reducing the amount of goods that can be produced at any given time.

To learn more about production possibilities frontier (PPF)

https://brainly.com/question/30627326

#SPJ9

Which shows the correct order for creating a new column in Datasheet view?
Scroll to the left, select data type, click on Click to Add, and name the field.
O Scroll to the right, select data type, name the field, and click on Click to Add.
Scroll to the left, select data type, name the field, and click on Click to Add
Scroll to the right, click on Click to Add, select data type, and name the field.

Answers

Answer:

Scroll to the right, click on Click to Add, select data type, and name the field.

Explanation:

What can cause the network slow down?

A network slows down when a network card is locked in a perpetual ________ mode.

Answers

A network can slow down when a network card is locked in a perpetual low-power mode.

What is perpetual  low power mode?

Perpetual low power mode refers to a state in which a device or component remains in a low power consumption mode continuously or for an extended period of time.  this mode is often implemented in electronic devices to conserve energy and prolong battery life

In perpetual low power mode the device operates at reduced performance levels  limiting its capabilities to conserve power

While low power mode can be beneficial for increasing battery life  it may also result in

reduced processing speeddecreased network performance and limited functionality

Learn more about perpetual low-power at

https://brainly.com/question/8303599

#SPJ1

Abel is designing a website for a startup IT firm. He intends to discuss the web design with his client. Which tool should Abel use to help his client get a idea of how the website will look?

A. bulleted list of titles, subheadings, and images

B. chart depicting the navigational flow of the website

C. layout of each page with its respective elements

D. pictures and screenshots of websites of other firms

E. programming code for the website ​​

Answers

Answer:

c

Explanation:

D.
Is the correct answer

List 3 specifications of electrical pylons​

Answers

Answer:

Large steel or concrete constructions used to support overhead electricity lines are called electrical pylons, often referred to as transmission towers. Long-distance electrical energy distribution and transmission depend heavily on these facilities. These are the three key characteristics of electrical pylons:

Material and structural layout: Galvanized steel or reinforced concrete are frequently used in the construction of electrical pylons. The choice of material is influenced by a variety of variables, including cost, load requirements, and environmental conditions. Pylons have a variety of structural designs based on their use and location, with lattice, tubular, and monopole constructions being some of the more popular options. The design must maximize material efficiency and cost-effectiveness while ensuring stability and strength.Height and clearance: The voltage of the power lines, the necessary height above the ground, and environmental concerns all play a role in determining the height of electrical pylons. Taller pylons are often needed for higher voltage lines in order to maintain enough clearance from the ground, trees, and other impediments. To ensure safety and stop electrical arcing, which might cause power outages or even fires, this clearance is essential.Insulators and conductor support: Electrical pylons sustain power lines by insulating them from the grounded tower structure. Insulators are devices that do this. Insulators are built to endure heavy mechanical loads and unfavorable climatic conditions. They can be composed of materials like porcelain, glass, or composite polymers. The quantity and kind of insulators are determined by the conductor arrangement, voltage level, and other elements.

A crucial part of the infrastructure for power transmission are electrical pylons. Its parameters, including those related to material and structural design, height and clearance, and the support systems for the insulators and conductors, are essential for assuring the efficient and dependable transfer of electrical energy over great distances.

A program is required to compute the cost of a car trip. The required input values are:

Litres per 100km
Distance travelled
Cost per litre of petrol
The output value is the total cost of the trip.

Answers

The program required to compute the above in Phyton is given below.

What is the program that computes the cost of a car trip using the above parameters?

the required program is given as follows;

# Input values

litres_per_100km = float(input("Enter the fuel efficiency of your car in litres per 100km: "))

distance_travelled = float(input("Enter the distance travelled in km: "))

cost_per_litre = float(input("Enter the cost per litre of petrol in your local currency: "))

# Calculate the total litres of petrol used

litres_used = (litres_per_100km / 100) * distance_travelled

# Calculate the total cost of the trip

total_cost = litres_used * cost_per_litre

# Display the result

print(f"The total cost of the trip is {total_cost:.2f} {currency_symbol}")



Note that this program prompts the user to enter the fuel efficiency of their car in litres per 100km, the distance travelled in km, and the cost per litre of petrol in their local currency.

It then calculates the total litres of petrol used by multiplying the fuel efficiency by the distance travelled, and calculates the total cost of the trip by multiplying the litres used by the cost per litre.

Finally, it displays the result to the user, rounded to two decimal places. Note that the currency symbol can be added to the output string depending on the user's location.

Learn more about phyton:

https://brainly.com/question/16757242
#SPJ1

19. Poverty is having
what's considered normal in a
society.
than
O A. more money or possessions
O B. less technology and other
possessions
C. slower Internet speeds
D. less money or possessions

Answers

Answer:

It is difficult to determine what is considered "normal" in a society as it can vary based on cultural, economic, and social factors. However, in general, possession of material goods such as money and possessions does not necessarily define normalcy in a society. Instead, normalcy may be defined by factors such as societal values, traditions, beliefs, and behaviors. Additionally, access to technology and the internet may be considered normal in some societies, while in others it may not be as prevalent or important.

Explanation:

Seva wants to sort several tables in Access but doesn't know how. Which icon should she click on?
A.) the square with the "x"
B.) the overlapping squares
C.) the "abc" with the checkmark
D.) the circle with the question mark

Answers

Answer:

C.) the "abc" with the checkmark is the icon to sort tables in Access.

Explanation:

Which best describes sorting, filtering, and deleting records?
A.) Sorting and filtering can be undone, but deleting records is a permanent change.
B.) Sorting can be undone, but filtering and deleting records are permanent changes.
C.) Deleting and filtering can be undone, but sorting records is a permanent change.
D.) Deleting can be undone, but sorting and filtering records are permanent changes.

Answers

Answer:

c) Deleting and filtering can be done undone,but but sorting records is a permanent change.

what is the storage of z900​ mainframe computer

Answers

Assuming you are referring to the IBM System z900 mainframe computer, the storage capacity can vary depending on the specific configuration and options selected.

The z900 uses high-speed storage technologies such as solid-state drives (SSDs) and magnetic disk drives (HDDs) to store data. The system can support various storage configurations, including internal and external storage options.

The internal storage options for the z900 include up to 32GB of main memory (RAM), which is used for active program and data storage during processing. Additionally, the z900 can support up to 136TB of disk storage, which can be divided into multiple logical partitions (LPARs) to provide secure and isolated storage for different applications or users.

An international bus touring company has two different ticket prices for its customers when they order online ahead of their departure time or at the gate:

Ticket Price Description:

Plan A: $19.95 per ticket online.

Plan B: $25.95 per ticket at the time of departure.

Plan C: $21.95 per ticket at the time of departure but in a group of 10 or more.

Write a program in Java that calculates a customer’s ticket when they order from all three plans. It should input customer name, mailing address, telephone number, which package the customer has purchased, and how many tickets were purchased.

Input Validation: Be sure the user only selects package A, B, or C. Display screenshots of the user using all three plans.

Answers

Answer:

import java.util.Scanner;

public class BusTicketCalculator {

   public static void main(String[] args) {

       Scanner input = new Scanner(System.in);

       // Get customer information

       System.out.println("Enter customer name:");

       String name = input.nextLine();

       System.out.println("Enter mailing address:");

       String address = input.nextLine();

       System.out.println("Enter telephone number:");

       String telephone = input.nextLine();

       // Get package and number of tickets

       System.out.println("Select a package (A, B, or C):");

       String packageOption = input.nextLine();

       while (!packageOption.equals("A") && !packageOption.equals("B") && !packageOption.equals("C")) {

           System.out.println("Invalid package selected. Please choose A, B, or C:");

           packageOption = input.nextLine();

       }

       System.out.println("Enter number of tickets:");

       int numTickets = input.nextInt();

       // Calculate ticket price based on package and number of tickets

       double ticketPrice = 0;

       if (packageOption.equals("A")) {

           ticketPrice = numTickets * 19.95;

       } else if (packageOption.equals("B")) {

           ticketPrice = numTickets * 25.95;

       } else if (packageOption.equals("C")) {

           if (numTickets >= 10) {

               ticketPrice = numTickets * 21.95;

           } else {

               ticketPrice = numTickets * 25.95;

           }

       }

       // Display ticket information

       System.out.println("\nTicket Information:");

       System.out.println("Name: " + name);

       System.out.println("Address: " + address);

       System.out.println("Telephone: " + telephone);

       System.out.println("Package: " + packageOption);

       System.out.println("Number of Tickets: " + numTickets);

       System.out.println("Total Price: $" + ticketPrice);

   }

}

This took a while as I am not extremely good at coding.

Explanation:

Here's an example Java program that calculates a customer's ticket when they order from all three plans and validates the input:

```
import java.util.Scanner;

public class TicketCalculator {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);

// Input customer information
System.out.print("Enter customer name: ");
String name = input.nextLine();
System.out.print("Enter mailing address: ");
String address = input.nextLine();
System.out.print("Enter telephone number: ");
String phone = input.nextLine();

// Input ticket information
System.out.print("Enter package (A, B, or C): ");
String packageCode = input.nextLine().toUpperCase();
while (!packageCode.equals("A") && !packageCode.equals("B") && !packageCode.equals("C")) {
System.out.print("Invalid package. Enter package (A, B, or C): ");
packageCode = input.nextLine().toUpperCase();
}
System.out.print("Enter number of tickets: ");
int numTickets = input.nextInt();

// Calculate ticket price
double ticketPrice;
if (packageCode.equals("A")) {
ticketPrice = 19.95;
} else if (packageCode.equals("B")) {
ticketPrice = 25.95;
} else {
if (numTickets >= 10) {
ticketPrice = 21.95;
} else {
ticketPrice = 25.95;
}
}

// Display ticket information
System.out.println("\nTicket Information");
System.out.println("Customer: " + name);
System.out.println("Address: " + address);
System.out.println("Phone: " + phone);
System.out.println("Package: " + packageCode);
System.out.println("Number of tickets: " + numTickets);
System.out.printf("Price per ticket: $%.2f\n", ticketPrice);
System.out.printf("Total price: $%.2f\n", ticketPrice * numTickets);
}
}
```

In this program, we first use the `Scanner` class to input the customer's name, mailing address, and telephone number. We then input the package code and validate it using a `while` loop. If the package code is invalid, we prompt the user to enter it again until it is valid. We also input the number of tickets. We then calculate the ticket price based on the package code and number of tickets, using an `if` statement for packages A and B and a nested `if` statement for package C. Finally, we display the ticket information, including the customer's name, address, and phone number, the package code, the number of tickets, the price per ticket, and the total price. We use the `printf()` method to format the output with two decimal places for the ticket prices.

Instructions
Add the function min as an abstract function to the class arrayListType to return the smallest element of the list.

Also, write the definition of the function min in the class unorderedArrayListType and write a program to test this function.

part 1
"unorderedArrayListTypeImp.cpp"
#include
#include "unorderedArrayListType.h"

using namespace std;

void unorderedArrayListType::insertAt(int location,
int insertItem)
{
if (location < 0 || location >= maxSize)
cout << "The position of the item to be inserted "
<< "is out of range." << endl;
else if (length >= maxSize) //list is full
cout << "Cannot insert in a full list" << endl;
else
{
for (int i = length; i > location; i--)
list[i] = list[i - 1]; //move the elements down

list[location] = insertItem; //insert the item at
//the specified position

length++; //increment the length
}
} //end insertAt

void unorderedArrayListType::insertEnd(int insertItem)
{
if (length >= maxSize) //the list is full
cout << "Cannot insert in a full list." << endl;
else
{
list[length] = insertItem; //insert the item at the end
length++; //increment the length
}
} //end insertEnd

int unorderedArrayListType::seqSearch(int searchItem) const
{
int loc;
bool found = false;

loc = 0;

while (loc < length && !found)
if (list[loc] == searchItem)
found = true;
else
loc++;

if (found)
return loc;
else
return -1;
} //end seqSearch


void unorderedArrayListType::remove(int removeItem)
{
int loc;

if (length == 0)
cout << "Cannot delete from an empty list." << endl;
else
{
loc = seqSearch(removeItem);

if (loc != -1)
removeAt(loc);
else
cout << "The item to be deleted is not in the list."
<< endl;
}
} //end remove

// Add the definition for the min function

void unorderedArrayListType::replaceAt(int location, int repItem)
{
if (location < 0 || location >= length)
cout << "The location of the item to be "
<< "replaced is out of range." << endl;
else
list[location] = repItem;
} //end replaceAt

unorderedArrayListType::unorderedArrayListType(int size)
: arrayListType(size)
{
} //end constructor

Answers

Answer:

part 1: Adding min as an abstract function to the class arrayListType

We cannot add an abstract function to the class arrayListType directly because it is a concrete class. Instead, we can make the function virtual and assign it a default implementation. Here's how we can do that:

class arrayListType {

public:

   virtual int min() const {

       int min = list[0];

       for (int i = 1; i < length; i++) {

           if (list[i] < min) {

               min = list[i];

           }

       }

       return min;

   }

   // rest of the class definition

};

Here, we made the min function virtual, which means that it can be overridden by derived classes. We also provided a default implementation of the function, which finds the minimum element of the list by iterating over all the elements and comparing them with a variable called min. We start with the first element of the list and update min whenever we find an element that is smaller. Finally, we return min.

part 2: Definition of min in the class unorderedArrayListType

Since the class unorderedArrayListType is derived from the arrayListType class, it inherits the min function. However, we can also override the function in the derived class if we want to provide a different implementation. Here's one way to do that:

class unorderedArrayListType : public arrayListType {

public:

   int min() const override {

       if (length == 0) {

           throw std::logic_error("Cannot find minimum of an empty list");

       }

       int min = list[0];

       for (int i = 1; i < length; i++) {

           if (list[i] < min) {

               min = list[i];

           }

       }

       return min;

   }

   // rest of the class definition

};


Here, we override the min function and provide a new implementation that is similar to the one in the base class, but with an additional check for the length of the list. If the list is empty, we throw an exception to indicate that we cannot find the minimum. Otherwise, we find the minimum in the same way as before.

part 3: A program to test the min function in the class unorderedArrayListType

Here's a sample program that tests the min function in the unorderedArrayListType class:

#include <iostream>

#include "unorderedArrayListType.h"

using namespace std;

int main() {

   unorderedArrayListType list(5);

   list.insertEnd(3);

   list.insertEnd(1);

   list.insertEnd(4);

   list.insertEnd(1);

   list.insertEnd(5);

   cout << "List: ";

   list.print();

   cout << "Minimum: " << list.min() << endl;

   return 0;

}


This program creates an instance of the unorderedArrayListType class with a maximum size of 5 and inserts some elements into the list. Then it prints the list, finds the minimum element using the min function, and prints the result. The output should be:

List: 3 1 4 1 5

Minimum: 1

Explanation:

15. What is the primary difference between how WPA2- Personal and WPA2-Enterprise are implemented on a network?

Answers

Answer:

The primary difference between WPA2-Personal and WPA2-Enterprise is in how the authentication process is handled.

WPA2-Personal uses a pre-shared key (PSK) method for authentication, where all users share the same password. This method is suitable for small home networks where there are a limited number of users.

On the other hand, WPA2-Enterprise uses a more complex method of authentication, such as the Extensible Authentication Protocol (EAP), to authenticate each individual user on the network. This method is more suitable for larger organizations with many users, as it provides greater security and control over network access. Additionally, WPA2-Enterprise requires the use of an authentication server, such as a RADIUS server, to manage user authentication.

Explanation:

how do you add characters on super smash bros crusade

Answers

Answer:

Download the character you want to add as a ".zip" or ".rar" file.

Extract the files from the archive to a folder on your computer.

Open the Super Smash Bros. Crusade folder and locate the "fighters" folder.

In the fighters folder, create a new folder with the name of the character you want to add.

Copy the extracted files from the character archive into the new folder you just created.

Start Super Smash Bros. Crusade and go to the character select screen.

If the character you added is not automatically unlocked, you may need to unlock them by completing certain objectives in the game.

Explanation:

Other Questions
The bar graph shows the results of rolling a number cube 300 times. How does the experimental probability of rolling a number greater than 1 compare with the theoretical probability? The experimental probability of rolling a number greater than 1 is __%, which is close to the theoretical probability of __% I dont know how to do thispls answer if u know with simple working 1. For what reasons does Demaratus think the Spartans will fight so hard to resist Xerxes?2. What does this passage reveal concerning Herodotus's attitude toward the Greeks? Toward the Persians? The Founding Fathers gained support for the Constitution by promisingA Bill of Rights would be established to protect individual freedomsB. citizens would not be required to pay taxesC. the President would be from the SouthD. all free males would be able to vote Which equation represents a line which is parallel to the line y = 2/3x 3 How to do?Can anyone give me the answer?! A bag contains red, blue, and green tokens. Don randomlychooses one token from the bag, records the color, andreplaces the token before choosing another token. Heperforms the experiment 100 times. The final tally of theresults is shown in the table below. Could someone help me type up a small Japanese powerpoint about my family? each of these will be a slide. I put blanks for my safety, in those spots put [name] or [age] etc so i can fill them in myself. Please type these in the order below.My name is [name], i am [age] years old and in 9th grade. I go to [school]My dads name is [name] and he is an engineer. He is [age] years old.My moms name is [name] and she is a waitress. She is [age] years old.My older brothers name is [name]. He is [age] years old.This should be typed in basic hiraganaThank you, i know it is a bit much In 1940, the average size of a privately owned farm in a particular country was 170 acres. In a recent year, the average size of a privately owned farm in the country had increased to 432 acres. What is this percent increase? Need some help in science Please help me im so confused on this 19. What is the length of side JN? (Round your answer to the nearest tenth.) 65 39 53 Cmo los mexicanos y latinoamericanos trabajaron para lograr el xito desde los primeros aos hasta la actualidad en la economia 4.02 Lesson Check Arithmetic Sequences (9) PLEASE HELP I bought a pie. It cost somewhere between 1.30 and 2.99. I gave a 24% tip, and the total price was still an exact number of a pence. When I paid with a 5 note I received five coins in my change (the fewest I could have been given for that amount). What were the two possible amounts of change I could have been given? Use the graphs of f and g to find (fg)(2). The water is reflecting light, Is this specular or diffuse reflection? explain your answer A transverse wave on a string travels at 40ms40 sm 40, start fraction, start text, m, end text, divided by, start text, s, end text, end fraction . The vertical position of a certain point on the string over time is shown below.What is the wavelength of the wave along the string? Games People Play Given the description and example of decisions within a game thoertic structure included with the creation article. Construct your own decision example of a conflict, disagreement, or confrontation that has or may occur. Construct a full game tree and/or matrix with ranked payoffs for each participant/player. This may come from business or personal experience, but if you'd rather you may take it from pop culture, ie tv, movies, or lierature. Again, my goal here is to get you to recognize the implcations of such strategic thinking in both business and personal settings. Question 2) Suppose you work for the Cheapo Coffee company and are tasked with studying their coffee shops around the country. You are interested in studying the number of cups of coffees sold per day at different cheapo coffee shops. To study this you randomly select 4 major cities from across the US. You visit each oh the cheapo coffee stores in these cities for a day and record the value is the number of customers they serve. You ultimately visit 17 shops and get the following data.35, 43, 48, 52, 58, 67, 73, 85, 106, 125, 136, 174, 199, 213, 274, 351a.What is the population in this question?b.What is the sample in this question