subject

3.Writeprogram codesusing forloop of the followingquestions. The code should be written incomplete JavaScript format. Show thedry run. a)Accept a number from the user, check if the number is a prime number and display an appropriate message. For example, if the user inputs 7, then display the message, “7 is a prime number”, otherwise if the user inputs 8, then display the message, “8 is not a prime number”.(Prime numberis a number whose only factors are1 and the number itself.)b)Display the factorialand the first fivemultiples of 5usinga singlefor loop.(Factorial is the product of an integer and all thepositiveintegers lesser thanit. Eg. 5!=1*2*3*4*5=120)

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 16:00, babyshazi
In a cellular network each cell is controlled by a tower what are these towers called?
Answers: 3
image
Computers and Technology, 21.06.2019 22:00, taniyahreggienae
What is the most important aspect of marking media? a. data labelingb. content descriptionc. electronic labelingd. classification
Answers: 2
image
Computers and Technology, 21.06.2019 22:30, 341404143
Ted wants to go out to a neighborhood park and shoot pictures of dew drops on grass. he wants to get a low-level angle of the dew drops. which support equipment should ted use? a. mini tripod b. pistol grip c. monopod d. body mount
Answers: 2
image
Computers and Technology, 22.06.2019 01:30, yudayang2012pa9u8p
Consider the following statements: #include #include class temporary { private: string description; double first; double second; public: temporary(string = "", double = 0.0, double = 0.0); void set(string, double, double); double manipulate(); void get(string& , double& , double& ); void setdescription(string); void setfirst(double); void setsecond(double); }; write the definition of the member function set() so that the instance variables are set according to the parameters. write the definition of the constructor so that it initializes the instance variables using the function set() write the definition of the member function manipulate() that returns a decimal number (double) as follows: if the value of description is "rectangle", it returns first * second if the value of description is "circle" it returns the area of a circle with radius first if the value of description is "cylinder" it returns the volume of a cylinder with radius first and height second. hint: the volume of a cylinder is simply the area of the circle at the base times the height. if the value of description is "sphere" it returns the volume of the sphere with radius first. otherwise it returns -1.0;
Answers: 1
You know the right answer?
3.Writeprogram codesusing forloop of the followingquestions. The code should be written incomplete J...

Questions in other subjects:

Konu
History, 04.02.2021 14:00
Konu
Mathematics, 04.02.2021 14:00
Konu
Chemistry, 04.02.2021 14:00