Write a test program that prompts the user to enter three sides of the triangle (make sure they define an actual triangle), a color, and a Boolean value to indicate whether the triangle is filled.

Answers

Answer 1

Answer:

   Scanner in = new Scanner(System.in);

       System.out.print("Please enter 3 sides of a triangle, color and " +

                       "whether it is filled or not (true false): ");

       double s1 = in.nextDouble();

       double s2 = in.nextDouble();

       double s3 = in.nextDouble();

       String color = in.next();

       boolean filled = in.nextBoolean();

       

       Triangle t1 = null;

       

       try {

           t1 = new Triangle(s1, s2, s3, color, filled);

       }

       catch (IllegalTriangleException ite) {

           System.out.println(ite.toString());

       }

       

       System.out.println(t1.toString());

       System.out.printf("Triangle color: %s, Triangle filled: %s%n" +  

                       "Area: %.2f%n" +  

                       "Perimeter: %.2f%n%n",

                   t1.getColor(),  

                   t1.isFilled(),

                   t1.getArea(),

                   t1.getPerimeter());

           

Explanation:

   Scanner in = new Scanner(System.in);

       System.out.print("Please enter 3 sides of a triangle, color and " +

                       "whether it is filled or not (true false): ");

       double s1 = in.nextDouble();

       double s2 = in.nextDouble();

       double s3 = in.nextDouble();

       String color = in.next();

       boolean filled = in.nextBoolean();

       

       Triangle t1 = null;

       

       try {

           t1 = new Triangle(s1, s2, s3, color, filled);

       }

       catch (IllegalTriangleException ite) {

           System.out.println(ite.toString());

       }

       

       System.out.println(t1.toString());

       System.out.printf("Triangle color: %s, Triangle filled: %s%n" +  

                       "Area: %.2f%n" +  

                       "Perimeter: %.2f%n%n",

                   t1.getColor(),  

                   t1.isFilled(),

                   t1.getArea(),

                   t1.getPerimeter());

           


Related Questions

Given a positive integer n, the following rules will always create a sequence that ends with 1, called the hailstone sequence:If n is even, divide it by 2If n is odd, multiply it by 3 and add 1 (i.e. 3n +1)Continue until n is 1Write a program that reads an integer as input and prints the hailstone sequence starting with the integer entered. Format the output so that ten integers, each separated by a tab character (\t), are printed per line.The output format can be achieved as follows:print(n, end='\t')Ex: If the input is:

Answers

What happens if you have two values with no operator between them

Answers

In Computer programming, if you have two values that has no operator between them, you would experience a syntax error.

What is a syntax error?

A syntax error can be defined as a type of error that typically occurs due to mistakes in the source code of a program such as:

Spelling of words.Punctuation errorsIncorrect labelsSpacing

This ultimately implies that, a misplacement of punctuation or spacing in a command during programming that causes the source code of a program to stop running is most likely a syntax error.

In conclusion, we can infer and logically deduce that if you have two values that has no operator between them, you would experience a syntax error in computer programming.

Read more on computer programming here: brainly.com/question/25619349

#SPJ1

In below freezing conditions, keep your fuel level at least _________ full to keep moisture from freezing in your gas line.

Answers

quarter tank at least

Use the drop-down menus to complete statements about how to use the database documenter

options for 2: Home crate external data database tools

options for 3: reports analyze relationships documentation

options for 5: end finish ok run

Use the drop-down menus to complete statements about how to use the database documenteroptions for 2:

Answers

To use the database documenter, follow these steps -

2: Select "Database Tools" from   the dropdown menu.3: Choose "Analyze"   from the dropdown menu.5: Click on   "OK" to run the documenter and generate the desired reports and documentation.

How is this so?

This is the suggested sequence of steps to use the database documenter based on the given options.

By selecting "Database Tools" (2), choosing "Analyze" (3), and clicking on "OK" (5), you can initiate the documenter and generate the desired reports and documentation. Following these steps will help you utilize the database documenter effectively and efficiently.

Learn more about database documenter at:

https://brainly.com/question/31450253

#SPJ1

Which type of memory management system is feasible for mobile computing?

Answers

The  type of memory management system is feasible for mobile computing is known to be built in memory (RAM).


What is memory management in mobile computing?

The term Memory Management is known to be the act of controlling as well as coordinating computer memory.

It  is one that tends to share some parts known as blocks to a lot of running programs to be able to optimize the total  performance of the system.

Therefore, based on the above, The  type of memory management system is feasible for mobile computing is known to be built in memory (RAM).

Learn more about memory management from

https://brainly.com/question/27993984

#SPJ1

What’s a person who enter the electrical trade with little or no experience called? A.journeyman B.An apprentice c. A rookie D. A starter

Answers

Answer:

C. Rookie

Explanation:

why is GDS important to travel industry?

Answers

Answer:

A Global Distribution System (GDS) is a wonderful tool that properties should use to reach customers easily. This is a central reservation system that allows travel agents to access hotel rates and availability as well as prices for flights, trains and rental car companies in real time.

What is the minimum number of app service plans that should be created

Answers

The minimum number of App Service plans that should be created depends on a person's  specific requirements and the workload you are planning to host

What is service plans

When you want to decide how many App Service plans to use, think about these things such as: If you have different apps that need different things or need to be kept separate for safety, you can put them in different groups so they don't affect each other.

Scalability means being able to handle more work. If you need to handle more work by making things bigger (vertical scaling) or having more of them (horizontal scaling), you might need to use multiple plans for each application.

Learn more about  service plans from

https://brainly.com/question/14249760

#SPJ1

If images around the edges of a monitor do not look right, the computer might have a(n)

access problem.
hardware problem.
Internet problem.
software problem.

I will give brainiest to best answer

Answers

Answer:

it would be a software problem.

Explanation:

this is because when your computer crashes, the software all "explodes" and resets.

Hardware Problem

If a manufacturer damaged something, it can cause issues that the software can not interpret. For example the screen is damaged. The pixels could be damaged on the screen and most likely not the fault of a software.

You just figured out the root cause of an application error. You changed some configurations on the affected machines and verified that the users have full functionality. What should you do next?

Answers

After resolving the application error and verifying that users have full functionality,the next step   is to document the changes made and the steps taken to resolve the issue.

How is this so?

This documentation   is crucial for future reference, troubleshooting, and knowledge sharing within the team.

Also, it is important tocommunicate the resolution to the relevant stakeholders,such as users or supervisors, to ensure they are aware of the resolution and can provide f  eedback if necessary.

Learn more about application error at:

https://brainly.com/question/30062195

#SPJ1

In this lab, you complete a partially prewritten Java program that uses an array.

The program prompts the user to interactively enter eight batting averages, which the program stores in an array. The program should then find the minimum and maximum batting average stored in the array as well as the average of the eight batting averages. The data file provided for this lab includes the input statement and some variable declarations. Comments are included in the file to help you write the remainder of the program.

Instructions
1.Ensure the file named BattingAverage.java is open.

Write the Java statements as indicated by the comments.

Execute the program by clicking "Run Code." Enter the following batting averages: .299, .157, .242, .203, .198, .333, .270, .190. The minimum batting average should be .157, and the maximum batting average should be .333. The average should be .2365.

Answers

Here is a high-ranking pseudocode that could resolve the question that prompts the user to interactively enter eight batting averages, which the program stores in an array.

The Pseudocode

Create an array to hold eight batting averages.

Prompt the consumer to list the eight batting averages and store them in the array.

Initialize variables to hold the minimum and maximum batting averages, and background ruling class to the first ingredient in the array.

Traverse the array, comparing each ingredient accompanying the minimum and maximum variables, refurbishing them as essential.

Calculate the average of the eight batting averages by calculate up all the fundamentals in the array and separating by the time of the array.

Display the minimum, maximum, and average batting averages to the consumer.

Read more about pseudocodes here:

https://brainly.com/question/24953880

#SPJ1

what is computers machain?

Answers

Answer:

the electronic device which take data process it and give meaningful results is called computer machine

Which search strategy is most similar to greedy search?

A.
depth-first search
B.
breadth-first search
C.
bidirectional search
D.
uniform-cost search

Answers

Answer:

I think the answer would be A.

Explanation:

If I'm wrong plz let me know (I think I may be wrong)

Discuss any five focus areas
for Green Computing you can concentrate on

Answers

Answer:

Five focus areas for Green Computing are:

Environmental conditionsInformation technology (IT) systemsCooling systemsElectrical systemsAir management systems

Explanation:  

Green computing refers to the art of managing very effectively information technology such that the current level of productivity is maintained or exceeded.

Many of the factors listed above are more typical to data centers.

Data centers are IT systems that consume lots of electricity whilst generating lots of heat.

Sustained over a long period of time, the heat generated will contribute to green-house gases as the cooling system that is required to keep the data houses cool are big.

Hence, the green computing protocol requires where possible, minimal electricity be expended in cooling the data warehouses.

Another suggestion that has been given is for systems and appliances to be shut down when not in use rather than being left on or on standby.

Cheers

Discuss some of the ways to allow a non-Windows device to authenticate with a Windows based network.

Answers

The existing rules are setup to allow access based on windows group membership. I need to get a wireless jetdirect connected to the wifi network.

what is the abbreviation of IP address​

Answers

Answer: Internet Protocol Address

Explanation: IP Address is the abbreviation of Internet Protocol Address

Hope this helps

--Wavey

the meaning of the abbreviation of IP address is: Internet Protocol address(IP address)

sorry if that isn't what you meant, but hope this helps

Define basic logical gates with its symbol, algebraic expression and truth table.​

Answers

Answer:

A truth table is a good way to show the function of a logic gate. It shows the output states for every possible combination of input states. The symbols 0 (false) and 1 (true) are usually used in truth tables. The example truth table shows the inputs and output of an AND gate.

Explanation:

explain about your business and sales after covid 19 pandemic​

Answers

The global economy has undergone tremendous disruption brought about by the pandemic, with some sectors being grievously hit while others have fresh openings.

What are the effects?

Its aftermath has hastened the conversion to e-business, remote work, and digital remodeling as firms have poured significant capital into technological solutions in order to ameliorate compliance to the current state of affairs. Companies further evaluated their delivery strategies and diversified places from where they sourced materials so as to minimize any single nation's or region’s influence.

Altogether, the pandemic has showcased the indispensable value of pliancy, robustness, and novelty for business operations, and those entities that were able to adeptly conform to the existing condition are predicted to thrive in the post-COVID period.

Read more about business here:

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

How do you modify WordArt? Give specific details and steps

NEED THIS ASAP

Answers

The steps to modify a WordArt text are:

Click on the Editing WordArt TextThen Double click or select  the WordArt image.Via the use of the Format command tab, in the Text group, select Edit Text and the Edit WordArt Text dialog box showThrough the use of the Text text box, make all changes you want.Select OK.

What is Word art?

Word art or text art is known to be a kind of an art that is made up of text, creating words or phrases along with  visual imagery.

Therefore, The steps to modify a WordArt text are:

Click on the Editing WordArt TextThen Double click or select  the WordArt image.Via the use of the Format command tab, in the Text group, select Edit Text and the Edit WordArt Text dialog box showThrough the use of the Text text box, make all changes you want.

Select OK.

Learn more about WordArt from

https://brainly.com/question/938171

#SPJ1

what is the full form of the OS?​

Answers

Answer:

OS: Operating System

The operating system performs all the basic tasks of any computer or mobile, such as memory management, file management, input and output handling, process management, etc.

Explanation:

How does a file reader know where one line starts and another ends?

Every line in a text file has a hidden EOL (end of line) set of characters.

Python knows how many characters to expect in a line.

The last item in a line of data does not have a comma after it.

Every line starts with a BOL (beginning of line) character.

Answers

Answer:

Every line in a text file has a hidden EOL (end of line) set of characters.

Explanation:

The EOL characters are CR+LF, a.k.a. carriage return (13) + line feed (10).

Some text files only use LF characters to denote a line ending.

Something passed from one generation to the next is.
A. a legacy
B. spirituality
C. socialization,
D. self-definition

Answers

Answer:

A. a legacy
A- a legacy
The meaning for a family legacy is attitudes that are passed down from generation to generation through the messages.
I hope this helps :)

C/C++ does not allow arrays to be manipulated as a whole; each element must be set or accessed individually. To make operating on whole arrays or contiguous portions of arrays easier, write the following utility functions.
void arrayFill(int *p,int n,int v); // fill n elements starting a p with the value v
void arrayReverse(int *p,int n); // reverse the order of n elements starting a p
void arrayCopy(int *p,int n,int *q); // copy n consecutive elements from q to p
bool arrayEqual(int *p,int n,int *q); // iff n consecutive elements of p and q are equal
You will need to write your own test code to make sure your functions work correctly. The follow is an example of how to do this, but it is unlikely to find all errors.
#include
int main()
{
int a[20] = {1,2,3,4,5,6,7};
arrayReverse(a+2,3);
assert(a[2] == 5);
assert(a[4] == 3);
arrayCopy(a+7,6,a+1);
assert(a[12]==7);
arrayFill(a+13,6,-1);
int b[20] = {1,2,5,4,3,6,7,2,5,4,3,6,7,-1,-1,-1,-1,-1,-1};
assert(arrayEqual(a,20,b));
}
NOTE: Your submission may not use the array index operator ([]). You must use pointers.
Submit your functions without main().

Answers

Answer:

#include <assert.h>

void arrayFill(int *p, int n, int v)

{

for (int i = 0; i < n; i++)

{

*p = v;

p++;

}

}

void arrayReverse(int *p, int n)

{

int *q = p + n - 1;

while (p < q)

{

int temp = *p;

*p = *q;

*q = temp;

p++;

q--;

}

}

void arrayCopy(int *p, int n, int *q)

{

for (int i = 0; i < n; i++)

{

*p = *q;

p++;

q++;

}

}

bool arrayEqual(int *p, int n, int *q)

{

for (int i = 0; i < n; i++)

{

if (*p != *q)

{

return false;

}

p++;

q++;

}

return true;

}

Explanation:

The code includes 4 utility functions to make operating on arrays in C++ easier:

arrayFill: This function takes a pointer to an integer (p), the number of elements to be filled (n), and a value to fill the elements with (v). It uses a for loop to iterate through the n elements, starting from the pointer p, and sets each element to the value v.arrayReverse: This function takes a pointer to an integer (p) and the number of elements to be reversed (n). It initializes a pointer q to point to the last element of the array (p + n - 1). Then it uses a while loop to iterate through the elements, starting from the first (p) and last (q) elements, swapping the values of each pair of elements until the pointers meet in the middle.arrayCopy: This function takes two pointers to integers (p and q) and the number of elements to be copied (n). It uses a for loop to iterate through the n elements, starting from the pointer q, and copies each element to the corresponding location pointed to by p.arrayEqual: This function takes two pointers to integers (p and q) and the number of elements to be compared (n). It uses a for loop to iterate through the n elements, starting from the pointers p and q, and compares each pair of elements. If any pair of elements are not equal, the function returns false. If all pairs of elements are equal, the function returns true.

Question 1 The Movie class includes a toString method. Suppose another class is using the Movie class and has declared m as a Movie and initialized m. Which TWO of the following would use the toString method correctly to print out information about the movie m? 1 point 1 System.out.println(m); 1 System.out.println(toString()); 1 System.out.println(m.toString); 1

Answers

The two print statement which would use the toString method correctly to print out information about the movie m are:

System.out.println(toString()); 1.System.out.println(m.toString()); 1.

What is a method?

In Computer programming, a method can be defined as a block of executable code (sets of instruction) that are written and used by programmers to break down a given problem into small but manageable fragments (pieces).

This ultimately implies that, methods are typically written and used by programmers to break down any complex problem into simple and manageable fragments (pieces) such as in modern programming languages, which comprises several predefined methods.

In conclusion, the "System.out.println(toString());1" and "System.out.println(m.toString()); 1" calls the toString() function which then returns the string representation of the object movie.

Read more on print methods here: https://brainly.com/question/19594241

#SPJ1

Assume a 2^20 byte memory:

a) What are the lowest and highest addresses if memory is byte-addressable?

b) What are the lowest and highest addresses if memory is word-addressable, assuming a 16-bit word?

c) What are the lowest and highest addresses if memory is word-addressable, assuming a 32-bit word?

Answers

a) Lowest address: 0, Highest address: (2^20) - 1. b) Lowest address: 0, Highest address: ((2^20) / 2) - 1. c) Lowest address: 0, Highest address: ((2^20) / 4) - 1.

a) If memory is byte-addressable, the lowest address would be 0 and the highest address would be (2^20) - 1.

This is because each byte in the memory requires a unique address, and since there are 2^20 bytes in total, the highest address would be one less than the total number of bytes.

b) If memory is word-addressable with a 16-bit word, each word would consist of 2 bytes.

Therefore, the lowest address would be 0 (representing the first word), and the highest address would be ((2^20) / 2) - 1.

This is because the total number of words is equal to the total number of bytes divided by 2.

Subtracting 1 gives us the highest address, as the addresses are zero-based.

c) If memory is word-addressable with a 32-bit word, each word would consist of 4 bytes.

In this case, the lowest address would still be 0 (representing the first word), and the highest address would be ((2^20) / 4) - 1.

Similar to the previous case, the total number of words is equal to the total number of bytes divided by 4.

Subtracting 1 gives us the highest address.

For more questions on address

https://brainly.com/question/30273425

#SPJ8

Susan has a sheet with both numerical and textual data. She has to enter the numerical data in currency format. She has to input the textual data in underlined format, and she has to wrap the text. Which formatting options will she use? Susan can use the tab to select options to format numerical data in a spreadsheet. She can use the tab to select the underlining option and the tab to wrap text in a cell or range of cells.

Answers

Answer:

Susan has a sheet with both numerical and textual data. She has to enter the numerical data in currency format. She has to input the textual data in underlined format, and she has to wrap the text. Which formatting options will she use?

Susan can use the [ Numbers ] tab to select options to format numerical data in a spreadsheet. She can use the [ Font Affects ] tab to select the underlining option and the [ Text Alignment ] tab to wrap text in a cell or range of cells.

Im not 100% sure hope this helps

One problem with digital data is that it can be vulnerable to hackers. What is a hacker?.

Answers

Answer:

A hacker is an individual who uses computer, networking or other skills to overcome a technical problem. The term also may refer to anyone who uses their abilities to gain unauthorized access to systems or networks in order to commit crimes.

write the steps to insert picture water mark​

Answers

Answer:

Is there a picture of the question?

Explanation:

How should the security for the database be different than security for the rest of the system? Does it make a difference for web-based data designs? If so, how?

Answers

The security for the database should be more stringent than the security for the rest of the system, as it contains the critical information that needs to be protected.

How should the security of the database be designed ?

The database security should be designed to ensure the confidentiality, integrity, and availability of the data. This means that access to the database should be limited to authorized users and activities should be audited to prevent unauthorized access or modifications.

For web-based data designs, the security of the database is even more critical, as the data is accessed over the internet and is therefore more vulnerable to attacks. Web-based data designs need to incorporate additional security measures such as user authentication, access controls, firewalls, intrusion detection, and prevention systems to protect the database from cyber threats.

Find out more on security at https://brainly.com/question/14369330

#SPJ1

Data analytics benefits both financial services consumers and providers by helping create a more accurate picture of credit risk.
True
False

Answers

Answer:

True

Explanation:

Other Questions
The economy of the Middle Colonies differed from the economy of Virginia described in the excerpt in that the Middle Colonies more oftenA.) relied on enslaved labor in citiesB.) imported enslaved Africans.) engaged in trans-Atlantic commerceD.) purchased land from Native Americans Which of the following is an example of a potential reasonable accommodation?Group of answer choicesAll of the answer choices are correct.providing training materials in multiple languagesWhich of the following statements best describes a diversity focus in staffing?Group of answer choicesAll interested individuals are treated in a similar manner.All of the answer choices are correct.Employees are representative of the available workforce.The culture, policies, and practices of the organization create an open and supportive environment.work schedule changes for those with disabilitiesflexible schedule to accommodate religious holidaysAccording to ADA, it is not permissible for employers to do which of the following at the pre-offer stage of assessment process?Group of answer choicesAsk the applicant to demonstrate how they could perform the jobWhen comparing external to internal selection, which of the following statements are true?Group of answer choicesmeasures of personality and cognitive ability have been found to be valid predictors for both internal and external selectionin practice, organizations can get more in-depth information about external candidates previous job experiencesexternal selection involves more steps than internal selectionmeasures of personality and cognitive ability, which are valid for external selection, have no value in internal selectionAsk if the applicant has any disabilities.None of the answer choices are correct.Ask the applicant if he/she can perform the job, with or without reasonable accommodation What does it mean when a company's Free Cash Flow (FCF) goes from 263.08 to negative 2,931, to negative 13,167.75 to a positive 2,166.25? A group of college students eager to get to Florida on a spring break drove the 630-mi trip with only minimum stops. They computed their average speed for the trip to be 53.6 mi/h. How many hours did the trip take? The treasurer of Riley Coal Co: is asked to compute the cost of fixed income securities for her corporation. Even before making the calculations, she assumes the aftertax cost of debt is at least 3 percent less than that for preferred stock, Debt can be issued at a yield of 110 percent, and the corporate tax rate is 21 percent. Preferred stock will be priced at $60 and pay a dividend of $640. The flotation cost on the preferred stock is $6 0. Compute the aftertax cost of debt. (Do not round intermediote colculations. Input your answer as a percent rounded to 2 decimal places.) b. Compute the aftertax cost of preferred stock. (Do not round intermediate calculotions. Input your answer as o percent rounded to) 2 decimal ploces.) In HIJ, i = 6.6 inches, j = 6.4 inches and H=62. Find the length of h, to the nearest 10th of an inch. Why Venezuela and Philippines are the most strongest contender when it comes to big 4 beauty pageant?Venezuela has 18 titles whilePhilippines has 15 titlesWhy? What's up with them? please help with this i need the answer pleas answer and do not just talk magine a monohybrid cross studying stem length. the tall phenotype (t) is dominant; and the short phenotype (t) is recessive. what would you predict for the gametes made by the tall plant of the p generation? true or false: aeneas regains his confidence after he gives a speech encouraging his men on the shores of libya. Each project is typically a single-student work. A team of a maximum of two students is also allowed. If youchoose to form a team of two, you should specify each persons contribution in your report.2. A rewritten report is required for each project. The report should be 1,000 to 1,500 words in length.3. The project cannot come from other courses, and you are not allowed to reuse any previous projects that youhave worked on.4. The project can be in one of the following forms.(1) Conduct experiments. If you choose to work on an experiment-based project, you will pick one or more materials of your own choice and perform experiments to study their materials properties. In this case, your report will be in a similar form to an experiment-based research article. Please include your methods and the images of your materials and experiments in the report. Reports without detailed methods and images from your own experiment will result in 0 points There are 40 students in class. 12 like pink best, 4 like yellow and the rest blue. What fraction of the class likes blue? What is the value of x? 1.The Chinese were the first to develop elaborate ___________ for home weaving and later for industrial production.(i)spindles(ii)molds(iii)blocks(iv)furnace2.Which one of the following statements is correct, with respect to Zimbabwes relationship with Mapungubwe?(a)Zimbabwe was able to control the ivory and gold trade because of its rich gold mines.(b)Zimbabwe was able to control the ivory and gold trade because of its trading tactics.(c)Zimbabwe was able to control the ivory and gold trade because of its relationship with Mapungubwe.(d)Zimbabwe was able to control the ivory and gold trade because of its nearness to the coast.(pls answer quickly it is urgent) Bring out clearly the objective of pricing by firms (6marks) plzzzzzzzz helppppppp!!!!!!Which of the following was NOT one of the advantages of growing sugar?Select the best answer from the choices provided..It sold for a high price in Europe.OB.It was easy to store during shipment.OC.It required little human labor.D.It was used in making alcohol; therefore, there was a high demand for it.ResetText True or false: health spending in the US is strongly informed by return on investment (the degree to which health of the population is improved) I need help with my Spanish homework 4. Assuming that the rectangles have whole number side lengths, why is it possible to draw two different rectangles that have an area of 30 square inches but not possible to draw two rectangles with an area of 7 square inches? Does anybody think 2021 is gonna be any better than 2020?