Create a method called nicknames that passes an array as a parameter. Inside the method initialize it to hold 5 names of your choice. Use the for each enhanced loop to print the elements of the array.

Answers

Answer 1
Answer:

    //======METHOD DECLARATION=========//          

    //method name: nicknames                                          

    //method return type: void                                            

    //method parameter: an array reference                    

    public static void nicknames(String [] names){      

       //initialize the array with 5 random names              

       names = new String[] {"John", "Doe", "Brian", "Loveth", "Chris"};

       //using an enhanced for loop, print out the elements in the array

       for(String n: names){

           System.out.print(n + " ");

       }

       

    }

Explanation:

The program is written in Java. It contains comments explaining important parts of the code. Kindly go through these comments.

A few things to note.

i. Since the method does not return any value, its return type is void

ii. The method is made public so that it can be accessible anywhere in and out of the class the uses it.

iii. The method is made static since it will most probably be called in the static main method (at least for testing in this case)

iv. The method receives an array of type String as parameter since the names to be stored are of type String.

v. The format of initializing an array manually should follow as shown on line 7. The new keyword followed by the array type (String), followed by the square brackets ([]) are all important.

vi. An enhanced for loop (lines 9 - 11) is a shorthand way of writing a for loop. The format is as follows;

=> The keyword for

=> followed by an opening parenthesis

=> followed by the type of each of the elements in the array. Type String in this case.

=> followed by a variable name. This holds an element per cycle of the loop.

=> followed by a column

=> followed by the array

=> followed by the closing parenthesis.

=> followed by a pair of curly parentheses serving as a block containing the  code to be executed in every cycle of the loop. In this case, the array elements, each held in turn by variable n, will be printed followed by a space.

A complete code and sample output for testing purposes are shown as follows:

==================================================

public class Tester{

    //The main method

    public static void main(String []args){

       

       String [] names = new String[5];

       nicknames(names);

    }

   

  //The nicknames method

    public static void nicknames(String [] names){

       names = new String[] {"John", "Doe", "Brian", "Loveth", "Chris"};

       for(String n: names){

           System.out.print(n + " ");

       }

       

    }

}

==================================================

Output:

John Doe Brian Loveth Chris

NB: To run this program, copy the complete code, paste in an IDE or editor and save as Tester.java


Related Questions

Jill is configuring the AutoArchive feature in Outlook 2016. What is the default setting in relation to when AutoArchive
will run?
o 7 days
0 14 days
30 days
O Never

Answers

Answer:

(b) 14 days

Explanation:

In the presence of thousands of mails each day or week, controlling what items to keep in an archive for cleaning up purposes becomes important. To do this, Outlook comes with an option called AutoArchive. The default setting in relation to when AutoArchive will run is 14 days. To change this setting, user will need to do the following:

i. Navigate to File  > Options > Advanced

ii. Under the AutoArchive menu, click on the AutoArchive settings

iii. Change the settings however way they want.

Answer:

That's correct it's 14 days

Explanation:

:) hope it helps

१८. तलका शीर्षकमा १५० शब्दसम्मको निबन्ध लेख्नुहोस् :
(क) सुशासन र विकास

Answers

Answer:

n

Explanation:

Answer:

kkkkkkkkikkkkkkkkkkkiikkiiii

Ryan would like to copy a list of contacts from a colleague into his personal address book. The list of contacts is
contained in a simple text file. What should he do first?
O Export from text to .pst.
Import directly from the text file.
O Format the text file with comma-separated values and save as CSV file type.
O Copy and paste the list into the address book.

Answers

Answer:

He should: Format the text file with comma-separated values and save as CSV file type. ]

Explanation:

hope this helps!

Answer:

c

Explanation:

How laggy is you're game cause I even lag in offline games this is just a random question. ​

Answers

Answer: its bad

Explanation:

Answer:

Lagging in offline games suggests there is something wrong with the computer, not the internet. There are various speed tests you can use to determine the speed of your internet! One being https://www.speedtest.net/ which is a more well known and trusted site. Depending on how old your computer is or if it is a laptop not build for games can influence your gameplay experience greatly.

An electronic ____ is an application you use to perform numeric calculations and to analyze and present numeric data.

Answers

An electronic [tex]\sf\purple{spreadsheet}[/tex] is an application you use to perform numeric calculations and to analyze and present numeric data.

[tex]\bold{ \green{ \star{ \orange{Mystique35}}}}⋆[/tex]

An electronic spreadsheet is an application you use to perform numeric calculations and to analyze and present numeric data.

What is electronic spreadsheet?

You may examine and show numerical data as well as execute numerical calculations using an electronic spreadsheet.

Microsoft Excel, Sheets, and Apple Numbers are a few examples of electronic spreadsheets.

Text, number, logical, and error data are the four categories of data. Each type can be used for a variety of tasks, so knowing which to use and when to use it is crucial.

You might also keep in mind that while exporting data into a spreadsheet, some data types might change.

You may examine and show numerical data as well as execute numerical calculations using an electronic spreadsheet.

Thus, the answer is electronic spreadsheet.

For more details regarding spreadsheet, visit:

https://brainly.com/question/8284022

#SPJ6

Discuss any five positive and five Negative impact
of ICT on society​

Answers

Answer:

The technology of information communication has the capacity to transform society. It plays a key part and provides the infrastructure needed to achieve each of the United Nations Sustainable Development Goals. It also allows financial integration by m-commerce and lets people connect instantly to millions.

ICT has a particularly important impact on business. It allows people to exchange knowledge and advice immediately and establish a website or online shop at a low cost, thus reducing the obstacles to starting a business dramatically. As such, it is a major factor in change and the maturity of ICTs is strongly connected to economic growth.

Explanation:

Effects of ICT

As a human beings, we are always associated in our everyday life with many essential things. The use of ICT equipment in our lifestyle has simplified many time-consuming calculations and difficult tasks, and social contacts have been strengthened. ICT has affected life by enhancing the timely distribution of media information and improved home and workplace communications via social networking, e-mail, etc.

The quality of human life has been greatly improved by ICT. For example, it could take a few days for a letter to come to the recipient, but a single minute for an e-mail to reach. ICT offers a broader understanding and information for each facility  24 Hrs X 7 days. In the following, ICT affects different fields of daily living.

Positive Impacts of ICT:

As domestic and home businesses.As social connectivity.As E-learning/ As educationAs for shopping/tradingAs for banksAs a job/jobs

Negative Impacts of ICT:

Face-to-face interaction reduced.Social Decoupling.Physical activity/health issues reduced.Cost.

Exam Lesson Name: Introduction to Design Technology
Exam number. 700796RR
> Exam Guidelines
Exam Instructions
Question 8 of 20 :
Select the best answer for the question
8. Cycling through the design process to create several models that incrementally improve a solution is called what?
O A. Six Sigma
B. Success criteria
C. Just-in-time production
D. Iterative design
Mark for review (Will be highlighted on the review page)
Type here to search
O
Bi
S

Answers

Answer:

D. Iterative design

Explanation:

An iterative design can be defined as a cyclic process which typically involves prototyping, testing, evaluating or analyzing and refining of a product, so as to continually improve the product.

In an iterative design process, the following steps are adopted;

1. A prototype of the product is first created and tested by the manufacturer.

2. The product is then evaluated to check for any defect or flaw.

3. The defect or flaw is fixed through a refining process.

4. The previous steps are repeated incrementally until an improved version of the product is created.

Hence, cycling through the design process to create several models that incrementally improve a solution is called iterative design.

Answer:

Iterative Design

Explanation:

A. It seeks to figure what it defective

B. It reaffirms if all requirements are met to solve a problem

C. It's main goal was to avoid excess products that might not end up making sales in the near future

D. Making several revision on problems to take out an efficient solution

D makes the most sense here.

A pointer can be used as a function argument, giving the function access to the original argument.
A. True
B. False

Answers

Answer:

True

Explanation:

A pointer can be used as a function argument, giving the function access to the original argument.

What is not a type of text format that will automatically be converted by Outlook into a hyperlink?
email address
web address
UNC path
O All will be automatically converted,

Answers

Answer:

d. All will be automatically converted.

Explanation:

A hyperlink is a link created in one document and that leads to another document mostly by clicking on that link. In Microsoft Outlook, some text formats are automatically converted to hyperlinks which are shown by first underlining the text and then changing the text color to blue. Some of the text formats that are turned to hyperlinks are:

i. email addresses

ii. web addresses

iii. UNC path: This is a path specifying the location of a particular document or resource on a computer or server. It has the following format:

\\name--of--server\resource-path-name

my iphone s6 is plugged in but isnttttt charging and the chager works on my ipad waaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

Answers

Answer:

Could be a defect on the charge port for the Iphone s6. There are inexpensive way to fix that problem. Super cheap parts and kits to help online to buy.

You trained a binary classifier model which gives very high accuracy on thetraining data, but much lower accuracy on validation data. The following maybe true:
a. This is an instance of overfitting.
b. This is an instance of underfitting.
c. The training was not well regularized.
d. The training and testing examples are sampled from different distributions.

Answers

Answer:

a. This is an instance of overfitting.

Explanation:

In data modeling and machine learning practice, data modeling begins with model training whereby the training data is used to train and fit a prediction model. When a trained model performs well on training data and has low accuracy on the test data, then we say say the model is overfitting. This means that the model is memorizing rather Than learning and hence, model fits the data too well, hence, making the model unable to perform well on the test or validation set. A model which underfits will fail to perform well on both the training and validation set.

you recieve a phone call from the sterlization monitoring company informing you that the last spore test you sent has failed. What should you check to determine the possible cause

Answers

Answer: The type sterilization that was used and how well it was performed

Explanation:

If there's a phone call from the sterilization monitoring company that the last spore test sent has failed, to determine the possible cause, I'll have to type sterilization that was used and how well it was performed.

The sterilization technique used will be analysed, and there'll also be a check for possible human errors. Once thus is done, the possible reason for the failure of the last spore that was sent can then be determined.

If your goal is for users to read information, create a web __________.

Answers

Answer:

Learn, I think hope this works?

Explanation:

the answer would be learn

Write a public static method named print Array, that takes two arguments. The first argument is an Array of int and the second argument is a String. The method should print out a list of the values in the array, each separated by the value of the second argument.
For example, given the following Array declaration and instantiation:
int[] myArray = {1, 22, 333, 400, 5005, 9}; printArray(myArray, ", ") will print out 1, 22, 333, 400, 5005, 9
printArray(myArray, " - ") will print out 1 - 22 - 333 - 400 - 5005 - 9

Answers

Answer:

Here is the output.

Explanation:

import java.util.Arrays;  

public class Main{  

   public static void main(String[] args){        

       int[] array={43,42,23,42,4,56,36,7,8,676,54};

       System.out.println(Arrays.toString(array));

       printArray(array,"*");

       System.out.println(""+getFirst(array));

       System.out.println(""+getLast(array));

       System.out.println(Arrays.toString(getAllButFirst(array)));

       System.out.println(""+getIndexOfMin(array));

       System.out.println(""+getIndexOfMax(array));

       System.out.println(Arrays.toString(swapByIndex(array, 1,2)));

       System.out.println(Arrays.toString(removeAtIndex(array,3)));

       System.out.println(Arrays.toString(insertAtIndex(array,3,65)));

   }  

   //---1----

   public static void printArray(int[] arr, String sep){  

       for(int i=0; i<arr.length-1;i++){  

           System.out.print(" "+arr[i]+" "+sep);  

       }  

       System.out.println(" "+arr[arr.length-1]);  

   }  

   //---2----  

   public static int getFirst(int[] arr){  

       return arr[0];  

   }

   //---3----  

   public static int getLast(int[] arr){  

       return arr[arr.length-1];  

   }  

   //---4-----  

   public static int[] getAllButFirst(int[] arr){  

       int[] anotherArray=new int[arr.length-1];  

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

           anotherArray[i-1]=arr[i];  

       }

       return anotherArray;

   }

//---5------  

   public static int getIndexOfMin(int[] arr){  

       int index=0;  

       int min=arr[0];  

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

           if(min>arr[i]){  

               min=arr[i];  

               index=i;  

           }  

       }

       return index;  

   }  

   //---6------  

   public static int getIndexOfMax(int[] arr){  

       int index=0;  

       int max=arr[0];  

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

           if(max<arr[i]){  

               max=arr[i];  

               index=i;  

           }  

       }  

       return index;  

   }  

   //---7------  

   public static int[] swapByIndex(int[] arr, int a , int b){  

       int temp=arr[a];  

       arr[a]=arr[b];  

       arr[b]=temp;  

       return arr;  

   }  

   //---8------  

   public static int[] removeAtIndex(int[] arr, int index){  

       int[] anotherArray = new int[arr.length - 1];  

for (int i = 0, k = 0; i < arr.length; i++) {  

if (i == index) {  

continue;  

}  

anotherArray[k++] = arr[i];  

}  

// return the resultant array  

return anotherArray;  

   }  

//---9------  

   public static int[] insertAtIndex(int[] arr, int index, int element){  

       int[] anotherArray = new int[arr.length + 1];  

for (int i = 0, k=0;k < arr.length+1; k++) {  

if (k == index) {  

anotherArray[k]=element;  

               continue;  

}  

anotherArray[k] = arr[i++];  

}  

// return the resultant array  

return anotherArray;  

   }  

//---10------  

   public static boolean isSorted(int[] arr){  

       for(int i=0; i<arr.length-1;i++){  

           if (arr[i+1]<arr[i]){  

               return false;  

           }  

       }  

       return true;  

   }  

}

For each compound below, identify any polar covalent bonds and indicate the direction of the dipole moment using the symbols δ +and δ-.
(a) HBr
(b) HCI
(c) H2O
(d) CH40

Answers

Answer:

H-Br bond is polar, hydrogen is partly positive and bromine is partly negative

H-Cl bond is polar, hydrogen is partly positive and bromine is partly negative

O-H bond in water is polar, hydrogen is partly positive and oxygen is partly negative

C-O bond in CH40 is polar, carbon is partly positive and oxygen is partly negative

Explanation:

A molecule possess a dipole moment when there is a large difference in electro negativity between two bonding atoms in the molecule.

The presence of dipole moments introduces polarity to the molecule. In all the molecules listed in the answer, the shared electron pair of the bond is closer to the more electronegative atom causing it to be partially negative while the less electronegative atom in the bond is partially positive.

Write a Java method that prints a list of characters using the following header:public static void printChars (char ch1, char ch2, int numPerLine)This method prints chars between ch1 and ch2 (inclusive); the number of chars per-line is specified by int variable numPerLine. Then write and test Java programs that printa) characters from 1 to Z (uppercase), ten chars per line; b) all lowercase letters followed by all uppercase letters, 13 per line (Hint: you may want to call the method printChars twice in this second part)Consecutive characters on the same line should be separated by exactly one space.

Answers

Answer:

The method and the test cases is as follows:

import java.util.*;

public class Main{

public static void printChars (char [tex]ch1[/tex], char [tex]ch2[/tex], int [tex]numPerLine[/tex]){

    int count = 0;

    for(char ch = ch1; ch<=ch2; ch++){

        System.out.print(ch+" ");

        count++;

        if(count == numPerLine){

            System.out.println();

            count = 0;         }     }

    System.out.println(); }

public static void main(String[] args) {

 printChars('1','Z',10);

 printChars('a','z',13);

 printChars('A','Z',13);

}}

Explanation:

See attachment for complete source file where comments are used as explanation

what are the different steps while solving a problem using computer? explain​

Answers

Explanation:

The following six steps must be followed to solve a problem using computer.

Problem Analysis.

Program Design - Algorithm, Flowchart and Pseudocode.

Coding.

Compilation and Execution.

Debugging and Testing.

Program Documentation.

Two hundred workstations and four servers on a single LAN are connected by a number of switches. You’re seeing an excessive number of broadcast packets throughout the LAN and want to decrease the effect this broadcast traffic has on your network. What steps must you take to achieve this goal?

Answers

Answer:

Add more servers or decrease the amount of workstations

To stop broadcast storms one can enable the use of Storm Detect feature that can help to disable a port if it is getting a lot of number of Broadcast or Multicast packets.

What is excess of broadcast storms?

A broadcast storm is known to be a kind of bad or high number of broadcast packets that occurs in a little or  short time frame.

Note that To stop broadcast storms one can enable the use of Storm Detect feature that can help to disable a port if it is getting a lot of number of Broadcast or Multicast packets.

Learn more about  storms from

https://brainly.com/question/7014058

#SPJ9

Define a function calc_pyramid_volume with parameters base_length, base_width, and pyramid_height, that returns the volume of a pyramid with a rectangular base. Sample output with inputs: 4.5 2.1 3.0 Volume for 4.5, 2.1, 3.0 is: 9.45 Relevant geometry equations: Volume

Answers

Answer:

Explanation:

The following is written in Java. It takes in the three values as parameters and then uses the formula for calculating the volume of a pyramid. Finally, returning the volume to the user. A test case has been provided in the main function and the output can be seen in the attached picture below.

class Brainly {

   public static void main(String[] args) {

       double output = calc_pyramid_volume(4.5, 2.1, 3.0);

       System.out.println(output);

   }

   public static double calc_pyramid_volume(double base_length, double base_width, double pyramid_height) {

       double volume = (base_length * base_width * pyramid_height) / 3;

       return volume;

   }

}

Which of the following Python methods is used to perform hypothesis testing for a population mean when the population standard deviation is unknown?

a. uttest(dataframe, null hypothesis value)
b. ztest(dataframe, null hypothesis value)
c. prop_1samp_hypothesistest(dataframe, n, alternative hypothesis value)
d. ttest_1samp(dataframe, null hypothesis value)

Answers

Answer:

B: ztest(dataframe, null hypothesis value)

The Python method that is used to perform a test of hypothesis for a population mean with an unknown population standard deviation is d. ttest_1samp(dataframe, null hypothesis value).

A t-test is normally applied when the population standard deviation is not known.  The researcher will use the sample standard deviation.

While the z-test can also be used in Python to perform hypothesis testing with a known population standard deviation and a sample size that is larger than 50, only the t-test can be applied with an unknown population standard deviation or a sample size less than 50.

Thus, the only Python method to carry out hypothesis testing with unknown population standard deviation is the t-test, which is given in option d.

Learn more about hypothesis testing at https://brainly.com/question/15980493

Write a python program that will accept monthly salary amounts greater than zero but less

than or equal to 400,000.00 until the user enters the character ‘e’. After the user

enters the character ‘e’, calculate the net pay of all salaries by deducting income tax at

a rate of 25%, pension of 5% and housing contribution of 2% from each salary

entered. Additionally, print the number of salaries that were entered in the program

along with the number of salaries that exceed 300,000.00

Answers

Answer:

b=0

c=0

lol=list()

while True:

   salary=input("Enter your salary: ")

   if salary=="e" or salary=="E":

       print("Thankyou!!")

       break

   else:

       a=int(salary)

       if a>=300000 and a<=400000:

            c=c+1

       if a<0 or a>400000:

           print("Your salary is either too small or too big ")

       if a>0 and a<=400000:

           a=a-(25/100*a)-(5/100*a)-(2/100*a)

           lol.append(a)

           b=b+1

           if a>=300000:

                c=c+1

print(lol)

print("The number of salaries entered is: "+ str(b))

print("The number of salaries that exceeded 300000 is: "+str(c))

Anyone wanna play league of legends, i play top and mid

Answers

Answer:

u get work

Explanation:

Web analytical packages can obtain the following information when someone visits a website, except Group of answer choices name and address of web visitors geographic location Internet connection type navigation source

Answers

Answer:

name and address of web visitors.

Explanation:

A website refers to the collective name used to describe series of web pages linked together with the same domain name.

Web analytical packages are software features that are typically used for tracking the identity of a computer system by placing or adding cookies to the computer when it's used to visit a particular website. Thus, it's only used for tracking the identity of a computer but not the computer users.

This ultimately implies that, web analytical packages can obtain the geographic location, Internet connection type, and navigation source information when someone visits a website, but it cannot obtain the name and address of web visitors or users.

explain any two factors to consider when classifying computer systems​

Answers

Answer:

The following classifications can be made of the computer systems:

1. According to size.

2. Functionality based on this.

3. Data management based. 

Explanation:

Servers:-

Servers are only computers that are configured to offer clients certain services. Depending on the service they offer, they are named. For example security server, server database.

Workstation:-

These are the computers which have been designed mainly for single users. They operate multi-user systems. They are the ones we use for our daily business/personal work.

Information appliances:-

They are portable devices that perform a limited number of tasks such as basic computations, multimedia playback, internet navigation, etc. They are commonly known as mobile devices. It has very limited storage and flexibility and is usually "as-is" based.

Consider a file system using the indexed allocation. The block size is 512 bytes and the pointer to a block takes 2 bytes. The largest file size that a one level indexed allocation method could handle is ___________ KB. Recall that 1KB is equal to 210 bytes. Answer -1 if there is no limit based on the provided information.

Answers

Answer:

128 KB      

Explanation:

Given data :

The block size = 512 bytes

Block pointer size = 2 bytes

In an indexed allocation, a special block named Index Block contains all the pointers to the blocks that the file had occupied.

Therefore, the maximum number of block pointer in 1 block :

[tex]$=\frac{\text{block size}}{\text{pointer size}}$[/tex]

[tex]$=\frac{512}{2}$[/tex]

= 256

Thus, a block can hold maximum 256 pointers.

It is given the level of indexing is one. So,

Maximum size of the file =  maximum number of block pointers in 1 file x block size

                                          = 256 x 512

                                          [tex]$=2^8 \times 2^9$[/tex]

                                          [tex]$=2^{8+9}$[/tex]

                                           [tex]$=2^{17}$[/tex]

                                          [tex]$=2^7 \times 2^{10}$[/tex]

                                          [tex]$=128 \times 2^{10}$[/tex]

                                          = 128 KB   (∵ 1 KB = [tex]2^{10} \ B[/tex] )

Therefore, the largest file that 1 level if indexed allocation method can handle is 128 KB.

How does a junction table handle a many-to-many relationship?

by converting the relationship to a one-to-one relationship
by moving the data from the source table into the destination table
by directly linking the primary keys of two tables in a single relationship
by breaking the relationship into two separate one-to-many relationships

Answer: 4
by breaking the relationship into two separate one-to-many relationships

Answers

Answer:

two" (and any subsequent words) was ignored because we limit queries to 32 words.

Explanation:

please mark as brainliest

Answer:

By breaking the relationship into two separate one-to-many relationships

Explanation:

I just did it / edge 2021

Select the correct answer.
Which part connects the CPU to the other
internal parts of a computer?
O A.
ALU
OB.
bus
O c. control unit
OD.
memory unit
O E. register

Answers

Answer:

I believe the correct answer is B. bus

Explanation:

The bus is the internal part that connects CPU and other parts to the rest of the computer.

The part that connects the CPU to the other internal parts of a computer is the bus. The correct option is B.

What are the different parts of a computer?

A motherboard, a central processor unit, a graphics processing unit, random access memory, and a hard disc or solid-state drive are the five fundamental components of every computer.

Every computer has 5 components, whether it is a high-end gaming system or a simple desktop system for kids. The CPU is the brain of your computer; it is responsible for all programming and computation. The motherboard, however, serves as the computer's brain, using circuits to link the CPU to other hardware components including memory, a hard drive, a CD/DVD drive, and all of your peripherals.

Therefore, the correct option is B. bus

To learn more about computers, refer to the link:

https://brainly.com/question/1483004

#SPJ2

What is food technology​

Answers

Answer:

is the application of food science to the selection, preservation, processing, packaging, distribution, and use of safe food. Related fields include analytical chemistry, biotechnology, engineering, nutrition, quality control, and food safety management.

Explanation:

spherevolume = (4.0 / 3.0) * pival * sphereradius * sphereradius * sphereradius ;

Answers

Answer:

The program in Python is as follows:

pival = 3.142

sphereradius = float(input("Radius: "))

spherevolume = [tex](4.0 / 3.0)[/tex] * [tex]pival[/tex] * sphereradius * [tex]sphereradius[/tex] * sphereradius

print(spherevolume)

Explanation:

The missing part of the program is to calculate the volume of a sphere.

The program in Python (in the answer section) is implemented using the already used variables.

Initialize pi

pival = 3.142

Get input for radius

sphereradius = float(input("Radius: "))

Calculate the volume

spherevolume = [tex](4.0 / 3.0)[/tex] * [tex]pival[/tex] * sphereradius * [tex]sphereradius[/tex] * sphereradius

Print the calculated volume

print(spherevolume)

Write a C++ program that reads a number and determines whether the number is positive, negative or zero using Switch operator method

Answers

Answer:

#include <iostream>

using namespace std;

template <typename T> int sgn(T val) {

   return (T(0) < val) - (val < T(0));

}

int main()

{

   cout << "Enter a number: ";

   int number;

   cin >> number;

   switch (sgn(number)) {

   case -1: cout << "The number is negative";

       break;

   case 0: cout << "The number is zero";

       break;

   case 1: cout << "The number is positive";

       break;

   }

}

Explanation:

You need the special sgn() function because a switch() statement can only choose from a list of discrete values (cases).

Other Questions
During its inception, Devon Company purchased land for $100,000 and a building for $180,000. After exactly 3 years, it transferred these assets and cash of $50,000 to a newly created subsidiary, Regan Company, in exchange for 15,000 shares of Regan's $10 par value stock. Devon uses straight-line depreciation. Useful life for the building is 30 years, with zero residual value. An appraisal revealed that the building has a fair value of $200,000. 5) Based on the information provided, at the time of the transfer, Regan Company should record: A) Building at $180,000 and no accumulated depreciation. B) Building at $162,000 and no accumulated depreciation. C) Building at $200,000 and accumulated depreciation of $24,000. D) Building at $180,000 and accumulated depreciation of $18,000. which gland will need to produce hormone after eating banana? A. pituitary gland B. thyroid C. adrenal glands D. Pancreas PLEASE SOMEONE HELP ME I WILL GIVE BRAINLIEST A shipping carton is in the shape of a triangular prism. The base area of the triangle is 6 inches squared and the the height of the prism is 15 inches. how many cubic inches of space are in the carton? Please somone help me with a chemistry question brainliest to whoever answers correctly and 20 points i tng ca t co l g help pleasee!!!!!!!! Help Brainliest to anyone who answers me ASAP!!!Which scenario is an example of a negative feedback loop?A. When body temperature increases, sweat is produced as a cooling agent to lower body temperature.B. In some parts of the world, birth rates are far exceeding death rates, which has led to overpopulation.C. Ice reflects sunlight much better than water. A warmer atmosphere is turning ice to water, which is absorbing more of the Suns energy.D. A warmer atmosphere is leading to warmer oceans. A warm ocean releases more carbon dioxide, which traps more heat in Earths atmosphere. let abc is a right angle triangle at b. if ac=10cm and ab=8cm the what is the lenght of bc is What was one of China's major achievements during the postclassical era?A. Developing gunpowder weaponsB. Founding the religion of Zen Buddhism C. Creating the first metal coinsD. Setting up the first Chinese dynasty In the decimal expansion of the fraction 1/13, what digit is in the 2021st decimal place?please answer correctly (full answers) CAN I GET THE REAL ANSWER I NEED THIS 100% MY MOM IS GOING WHOOP ME TILL I GOT 10 STAINS ON MY BUTT AND LEGS PLEASE HELP Please help me figure out which is the correct answer, i have attached the picture for you to look at. Thanks so much! Jeremy uses 2 feet 3 inches of board for each birdhouse he builds. How many inches of board does he need to make 6 birdhouses? Use a number line to solve? can sombody help me with a this question Chris and Jen decide to go apple picking at a local apple orchard. As the number of apples they pick increases the cost of the apples also increases. The function ff relates the varying cost of Chris and Jen's apples, cc , in terms of the varying number of pounds of apples that Chris and Jen pick, nn , where c=f(n)c=f(n) and ff is defined by f(n)=0.4n+6f(n)=0.4n+6.Evaluate f1(33) Note( this is F^-1)Determine the rule for the function f^-1 After the student closes the cooler, there NOT any inputs or outputs from this system because ________. a. no energy is being transferred into or out of the cooler b. there is no flow of energy across the system boundary c. there is no matter flowing into or out of the system d. all of the above Songs where the song writer did more work then the performer Based on paragraph 3, the reader can conclude that competition among elite runners is - A nonexistentB secretiveC friendlyD intenseI need by 11:00 pm new york time pleaseeeee 1. Ortografa de la palabra. Completa con a ver, haber, a haber.a) Vamos ______, quin ha ido _____ laexposicin del Museo de Len?