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
Agata [3.3K]
4 years ago
9

In C++, write a program that asks the user to input an integer and then calls a function named

Computers and Technology
1 answer:
barxatty [35]4 years ago
7 0

Answer:

//Program in C++.

// header

#include <bits/stdc++.h>

using namespace std;

// function to multiply number with 2-10

void multiplicationTable(int num)

{

   cout<<"Number when multiplied with 2-10:"<<endl;

   for(int a=2;a<=10;a++)

   {

   // multiply number with 2-10

      cout << num << " * " << a << " = " << num*a << endl;

   }

}

// driver function

int main()

{

// variable

   int num;

   cout<<"Enter a number:";

   // read number from user

   cin>>num;

   // call the function

   multiplicationTable(num);

return 0;

}

Explanation:

Read a number from user and assign it to variable "num".Call the function  multiplicationTable() with parameter "num".In this function, multiply number  with each from 2 to 10 and print the value.

Output:

Enter a number:5                                                                                                          

Number when multiplied with 2-10:                                                                                          

5 * 2 = 10                                                                                                                

5 * 3 = 15                                                                                                                

5 * 4 = 20                                                                                                                

5 * 5 = 25                                                                                                                

5 * 6 = 30                                                                                                                

5 * 7 = 35                                                                                                                

5 * 8 = 40                                                                                                                

5 * 9 = 45                                                                                                                

5 * 10 = 50

You might be interested in
I'm stuck on this Java exercise problem and don't know how to organize my code with proper formatting and it's not helping that
Volgvan

In your "count spaces method" before the for loop, you want to declare an int variable (let's call it spc)

then, each time you find that charat, spc++.


also, the string must be declared in the main method, not the spaces count method.


The actual code:


public class CountSpaces{

public static void main(String[] args){

String instring = "(your quote here)";

int spaces = calculateSpaces(instring);

System.out.println("The number of spaces is " + spaces);

}

public static int calculateSpaces(String in){

int spc = 0;

for(int i= 0; i<in.length; i++){

if(in.charAt(i)== ' '){

spc++;

}

}

return spc;

}

}


that should be it.  If you have any questions, feel free to reach out.

4 0
3 years ago
In a spreadsheet, cells B2 through B10 store the cost price of items and cells C2 through C10 store the selling price. If the se
Ad libitum [116K]
The correct formula to use is <span>=IF(C2>B2;"Profit";"Loss"). The condition set is that if the selling price(C Column) is greater than the cost price(B Column), you earn a profit. When encoded in the formula, the translation in this statement would be C2>B2. When you use the formula </span>=IF(C2>B2;"Profit";"Loss"), the first word will be shown when the condition set is applicable. <span>In this case, if the condition is true, it displays the word "Profit" but otherwise, it displays "Loss".          </span>
4 0
3 years ago
Read 2 more answers
One critique of determining the effectiveness of the psychodynamic perspective is that its theories are too vague to test. t/f
Feliz [49]
TRUE

Psychodynamic theories are usually too vague to allow a clear scientific test. Modest support for central psychodynamic hypotheses has been provided by Empirical studies. Critics have in the past disputed very many aspects of psychoanalysis including whether it is indeed a science or not. However much this is so, psychoanalysis is a great idea in personality that should never be overlooked.






3 0
4 years ago
Read 2 more answers
It’s important to consider adjusting a user’s social network permissions (or access) because
Liula [17]
<span>You may not want to share access to social networks with other members of your team. Also you may want to adjust your users social permission for security reasons, just to be on the safe side. A stronger network means you have a lower chance of a hacker breaking through your system.</span>
5 0
3 years ago
Four actions that can be implemented on a database to autocorrect violations of referential integrity, and the outcomes of the a
Paraphin [41]

Answer:

Follows are the matching to this question:

Option \ a \to \ Option \ 3\\\\Option \ b \to \ Option \ 4\\\\Option \ c \to \ Option \ 1\\\\Option \ d \to \ Option \ 2\\

Explanation:

While time-consuming or prone to errors mechanical adjustments to both the referential, databases could be configured with four measures to engine violations. The restricted action causes the insert, update, and removes to only be denied. Set Null to NULL sets the invalid external key, whereas Set Default to a specific core consideration specified in SQL sets a default foreign key. Its Cascade operation spreads the main changes in external keys.

6 0
3 years ago
Other questions:
  • Which term defines a star system with two stars?
    13·2 answers
  • Ponce is the largest city on which coast of Puerto Rico
    13·1 answer
  • What components are in hard drives?
    12·1 answer
  • Please help! i need to answer this soon!
    13·1 answer
  • Which of the following is not one of the Generally Accepted Recordkeeping Principles ("The Principles®")? a. Accountability b. S
    11·1 answer
  • Which of the following describes the pre-phase of an interview
    7·1 answer
  • You are given a 11-bit floating point representation with 1-sign bit, 3 bits for the exponent, and 7-bits for the mantissa. Expr
    9·1 answer
  • What is the best way to get the most out of the box?
    14·2 answers
  • Which one is not considered part of the cinematography team?
    7·2 answers
  • Select a software package/electronic device that you know well. It can be from any domain (work related, entertainment, desktop,
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!