1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
adoni [48]
2 years ago
6

write a script to check command arguments. Display the argument one by one (use a for loop). If there is no argument provided, r

emind users about the mistake.
Computers and Technology
1 answer:
algol132 years ago
4 0

Answer and Explanation:

Using Javascript programming language, to write this script we define a function that checks for empty variables with if...else statements and then uses a for loop to loop through all arguments passed to the function's parameters and print them out to the console.

function Check_Arguments(a,b,c){

var ourArguments= [];

if(a){

ourArguments.push(a);}

else( console.log("no argument for a"); )

if(b){

ourArguments.push(b);}

else( console.log("no argument for b"); )

if(c){

ourArguments.push(c);}

else( console.log("no argument for c"); )

for(var i=0; i<ourArguments.length; i++){

Console.log(ourArguments[i]);

}

}

You might be interested in
For a new version of processor, suppose the capacitive load remains, how much more energy will the processor consume if we incre
xxMikexx [17]

Answer:

72.80 % more energy will be consumed.

Explanation:

First of all, let us have a look at the formula of energy for a processor.

E = CV^2f

Where, E is the energy

C is the capacitance

V is the voltage and

f is the clock rate.

Let E_1 be the energy of older processor.

C_1 be the capacitance of older processor.

V_1 be the voltage of older processor

f_1 be the capacitance of older processor

So, E_1 = C_1V_1^2f_1 ....... (1)

and

Let E_2 be the energy of newer processor.

C_2 be the capacitance of newer processor.

V_2 be the voltage of newer processor

f_2 be the capacitance of newer processor

E_2 = C_2V_2^2f_2 ....... (2)

Dividing equation (2) with equation (1):

\dfrac{E_2}{E_1} = \dfrac{C_2V_2^2f_2}{C_1V_1^2f_1}

As per given statement:

C_1=C_2

V_2=1.2\times V_1

f_2=1.2\times f_1

Putting the values above:

\dfrac{E_2}{E_1} = \dfrac{C_1\times (1.2V_1)^2\times 1.2f_1}{C_1V_1^2f_1}\\\Rightarrow \dfrac{E_2}{E_1} = \dfrac{(1.2)^2\times 1.2}{1}\\\Rightarrow \dfrac{E_2}{E_1} = 1.728\\\Rightarrow \bold{E_2 = 1.728 \times E_1}

Energy consumed by newer processor is <em>1.728 </em>times the energy consumed by older processor.

OR

<em>72.80 %</em> more energy will be consumed by the newer processor.

4 0
3 years ago
Where is the typical location of a touchpad inside of a laptop?
butalik [34]

Answer:

Attached to the keyboard

Explanation:

Touch pad is the type of the mouse that is located on the laptop just near the keyboard or we can say that it is attached to the keyboard of the laptop. It has almost two buttons that are used for the purpose of Left and Right Click.

The touch pad is used to move the cursor to the required position on the screen of the laptop. This will work by just moving figure on the touch pad as the cursor move on the screen in the same direction of the finger..

5 0
3 years ago
To accomplish a certain task when you would rsther be doing something else is an example of
fenix001 [56]

Answer:

Self Discipline

Explanation:

his is because you train your brain to do the right thing.

I hope I helped. Thank you for your time.

6 0
3 years ago
I am trying to figure out why I keep having the errors on the right side.
Y_Kistochka [10]

Shut down your computer and try again.

6 0
3 years ago
ProcessName2
RoseWind [281]

Explanation:

This is easily solvable with a for loop. Something like:

(I assume c++)

#include <iostream>

#include <string>

int main() {

take_input: //tag

std::string input;

cin >> input; //take the input

int spaceCount = 0;

char checking;

for(unsigned int i = 0; i == input.length(); ++i) {

checking = spaceCount[i];

if(checking == ' ')

spaceCount++;

}

if(spaceCount >= 1 && input.length >= 5)

std::cout << "Your name is " + input;

else

goto take_input; // reasks for input if the conditions are not met

return 0;

};

**remove all spaces before using the code, the if statements are messed up

5 0
3 years ago
Other questions:
  • Which of the following typically have the highest auto insurance premiums?
    14·1 answer
  • Karen has opened a new business and is using Google Display Ads to build awareness of her new products. How does Google Display
    6·1 answer
  • Which of the following is not a main function within end user support?
    13·1 answer
  • _____ is a systems development technique that produces a graphical representation of a concept or process that systems developer
    11·1 answer
  • The process known as "bitmapping" is defined as information in _____. PLEASE HELP FAST
    11·1 answer
  • How have productivity programs improved the professional lives of people? (check all that apply)
    8·2 answers
  • Which of the following statements is TRUE of the information systems (IS) department? A. The operations group monitors user expe
    8·1 answer
  • The complete process for learning through repetition is to read, write, say, rest and revisit the information. Please select the
    12·2 answers
  • List 10 examples of computer ethics<br>(please give even 1 if you can, I need it urgently) ​
    10·1 answer
  • Future Cell Tech, a company that produces cell phones, is always on top of the newest technology and is the leader in cell phone
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!