Answer:
myDoubles.add(75.6);
Explanation:
ArrayList<Double> myDoubles = new ArrayList<Double>();
myDoubles.add(10.8);
myDoubles.add(92.46);
myDoubles.add(75.6);
The above code creates a double ArrayList called myDoubles. We add 10.8 and 92.46 initially. After these numbers, 75.6 is added to the myDoubles using <em>add</em> method (You need to type the list name, ".", and the method name to add the number)
The first one is the best one
The code segment does not compile because the method 'reset' does not return a value that can be displayed.
A method refers to a block of that which only runs when it is called. It is permissible to pass data, referred to as parameters, into a method. Methods are used to accomplish certain actions, and they are also called functions. As per the given code segment that appears as a method in a class, it does not compile because the method named 'reset' is not returning a value that can be printed on the screen as an output.
"
<em>Complete question:</em>
Consider the following code segment, which appears in a method in a class other than password.
Password p = new Password("password");
System.out.println("The new password is " + p.reset("password"));
The code segment does not compile because _____________ .
"
You can learn more about Method at
brainly.com/question/27415982
#SPJ4
Answer:
# include<iostream>
# include<math.h>
using namespace::std;
void calc (int num)
{
cout<<"Area of Square" <<num*num;
cout<<"Volume of a sphere" << (4/3) *3.14*num*num*num;
cout<<"Side of a Square" <<sqrt(num);
}
int main ()
{
int num;
cout<<"Enter the Number"; cin>>num;
calc(num);
return 0;
}
Explanation:
I have used the swtich for the selection purpose. Also, I have used sqrt() function, and for that I have included math,h library. And the various formula comes from mensuration. Rest part is self explanatory.
You must use “scanf” statement to read the input. You must also include the necessary header file to use all the built-in functions in any programming languages.
scanf(“%d”, &number);
Since “scanf” is a statement it must end with the semicolon. “scanf” accepts two parameters, first the type of value and second is the address of the variable to store the given input.
Here “&” represents the address of the given variable. “%d” is used for integer, “%f” is used for float, “%s” is used to receive string inputs, etc.