In C++, write a program that asks the user to input an integer and then calls a function namedmultiplicationTable(), which displays the results of multiplying the integer by each
of the numbers 2 through 10.

Answers

Answer 1
Answer:

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


Related Questions

Using for loop . Input an integer and identify whether it's EVEN OR ODD ( without using modulo operator )using only . C++ programming
Which is an example of adaptive social behavior?
The ticketing system at the airport is broken, and passengers have lined up to board the plane in the incorrect order. This line is represented in an ArrayList tickets in the AirLineTester class. Devise a way to separate passengers into the correct boarding groups. Currently, there is an AirlineTicket class that holds the information for each passengers ticket. They have a name, seat, row, and boarding group. Use the TicketOrganizer class to help fix the order of passengers boarding. First, create a constructor that takes an ArrayList of AirLineTickets and copies it to a class variable ArrayList. Then, create a getTickets method to get the ArrayList of AirLineTickets. In the TicketOrganizer class, create a method called printPassengersByBoardingGroup that prints out the name of the passengers organized by boarding group. The boarding groups go from 1-5, and have been predetermined for you. This should print the boarding group followed by all passengers in the group:
why is the disk method a special case of the general slicing​ method? choose the correct answer below. a. the cross sections of the slices are disks with holes through them. b. the functions that generate the solids are all lines. c. the functions that generate the solids are all parabolas. d. the cross sections of the slices are disks.
Please help I’m on a timer!!! Arie is moving icons around and deleting shortcuts. He is working on the _____.A. All programs submenuB. Start menuC. System trayD. Desktop Arie is moving icons around and deleting shortcuts. He is working on the _____.A. All programs submenuB. Start menuC. System trayD. Desktop

Suppose the author of an online banking software system has programmed in a secret feature so that the program emails him the account information for any account whose balance has just gone over $10,000. What term best describes this approach to computer crime and what are some of its harm?

Answers

Answer and Explanation:

This type of attack is caused by Trojan Horse.

Most of the times, Trojan is veiled as genuine programming which for this situation is an internet banking framework and can empower the spying by the cyber criminals, theft and gain to remote access to your framework and data. These activities can include:  

  • Erasing information  or data
  • Key logging  
  • Information Corruption /Corruption of data
  • Duplicating data
  • Blocking information  

Among other hurtful activities none of which look good with the beneficiary PC.

Outline 3 computer system problem that could harm people and propose the way avoid the problem​

Answers

Answer:

outline 3 computer system problem that could harm people and propose the way avoid the problemare:_

  1. Computer Won't Start. A computer that suddenly shuts off or has difficulty starting up could have a failing power supply.
  2. Abnormally Functioning Operating System or Software.
  3. Slow Internet.

Suppose that a queue is implemented using a circular array of size 12. What is the value of last after the following operations?10 enqueue operations
5 dequeue operations
6 enqueue operations
10 dequeue operations
8 enqueue operations
2 dequeue operations
3 enqueue operations
Last = 10

Answers

Answer:

10

Explanation:

An enqueue operation is a function that adds an element(value) to a queue array. A dequeue operations removes an element from a queue array. Queue arrays follow a first-in-first-out approach, so elements that are first stored in the queue are removed/accessed first(enqueue operations add elements at the rear of the queue array).

The following operations leave 10 elements in the queue of array size 12 after its done:

10 enqueue operations= adds 10 elements

5 dequeue operations= removes 5 elements( 5 elements left in queue)

6 enqueue operations= adds 6 elements(11 elements in queue)

10 dequeue operations= removes 10 elements(1 element left in queue)

8 enqueue operations= adds 8 elements(9 elements in queue)

2 dequeue operations= removes 2 elements(7 elements left in queue)

3 enqueue operations= adds 3 elements(10 elements in queue)

Therefore there are 10 elements in the queue after enqueue and dequeue operations.

When emergency changes have to be made to systems, the system software may have to be modified before changes to the requirements have been approved. Suggest a model of a pro- cess for making these modifications that will ensure that the requirements document and the system implementation do not become inconsistent.

Answers

Answer:

The Agile model

Explanation:

We can point out that this is all about the software development lifecycle model. In the software developmental lifecycle, the agile model is the most suited model that can be used to bring changes as per the requirement.

It is the model that provides huge flexibility as the changes can be made to the software even if the application is running. Moreover, this model follows documentation regarding the process of bringing the changes to the software. And even the new changes should pass the quality assurance test in order to go to the production phase.

What this does is that it actually ensures that your application is fit and is consistent to handle and perform operations.

Assume you have a system where you need to maintain operability even during the failing, replacing, and rebuilding of a failed disk. Thus, the data in the failed disk must be rebuilt and written to the replacement disk while the system is in operation. Which of the RAID levels yields the least amount of interference between the rebuild and ongoing disk accesses?

Answers

Answer:

RAID level 1 fits the criteria to yield the least amount of interference between the rebuild and ongoing disk accesses.

Explanation:

RAID system can be defined as the process in which hard drives which are connected to the system are been set up in order to help speed up the performance of a computer system disk storage which is why RAID is mostly used on servers and high performance computers system . This RAID as well helps to combines multiple physical disk drive components into various logical units for the aim of increasing system performance.

Therefore RAID level 1 fits the criteria to yield the least amount of interference between the rebuild and ongoing disk accesses. This is because the level 1 of RAID copies just the data from the failed Systems disk mirror during the rebuilding period where as the other levels of RAID copies the whole lot of content of the other disks due to the fact that RAID 1 often requires at least minimum of two physical drives because data is written simultaneously to two places in which the drives are essentially mirror images of one another in which if one fails, the other one can take over and help to provide access to the data that is been stored on that drive.

Write an if-else statement with multiple branches. If givenYear is 2101 or greater, print "Distant future" (without quotes). Else, if givenYear is 2001 or greater (2001-2100), print "21st century".

Answers

Answer:

import java.util.Scanner;

public class num9 {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       System.out.println("Enter year");

       int givenYear =in.nextInt();

       if(givenYear>=2101){

           System.out.println("Distant Future");

       }

       else if(givenYear>=2001){

           System.out.println("21st Century");

       }

   }

}

Explanation:

  • Using Java programming Language
  • Import Scanner class to receive user input of the variable givenYear
  • Use if statement to check the first condition if(givenYear>=2101)
  • Use else if statement to check the second condition if(givenYear>=2001)
  • print Distant future and 21st century respectively
Other Questions