
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question

Transcribed Image Text:7:53 O
了|" |"些
CPE162_exer2.15.doc
Computer Engineering Department
Laboratory Activity Form
Course Number
CPE162
Course Title
Computer Programming 2
Implement programs involving the use of while, do-while and for loop
Objectives:
statement.
Topics Covered:
Iteration, Nested Loops
Description
Generate an (n X m) Multiplication table. Use a nested-loop.
Sample Output if Applicable
The format of the table should be exactly the same on the image below.
Output will be:
input value of n = 12
input value of m = 12
CA 0:Ruel Lauron\C_Programs\1 2by12_multip_table_2.exe
1
2
4
5
6
8
10
11
12
4
8
10
12
15
16
20
20
25
24
30
28
35
32
40 48
36
45
40
50
44
55
48
60
5
12
18
24
6
7
14
21
28
35
42 48
49 56
56
63
70
7
10
20
30
40
50
60
70
80
90
90 100 110 120
99 110 121 132
96 108 120 132 144
8
9
18
27
36
45
54
63
72
81
11
12
22
24
33
36
44
48
55
60
66
72
77
84
88
96
99 108
16
24
32
40
9
12
15
18
21
24
27
30
33
36
10
30
36
42
8
9
20
54
60
66
72 84
64
72
80
88
12
Remarks / Additional Instructions
Filename : EXER2_15.C
Lab. Instructor/Teacher: Rex Seadiño
W
69E
2468日2468日24
1234567∞02
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 2 steps with 1 images

Knowledge Booster
Similar questions
- Write a code which take integer from user and reverse the number using while loop (Number could contain n no of digits). Example: Input: 2548 Output: 845arrow_forwardPlease provide answer in python code to attatched coding problem. Please also use specified sample input and output in coding solution. Thank you.arrow_forwardPlease help me with the listed revisions for the code below. Thank you. from math import pi, sin def m_trapz(f, a, b, n=100): res = (f(a)+f(b))/2 h = (b-a)/n for k in range(1, n): res = res+f(a+h*k) da = (f(a+h)-f(a))/h db = (f(b)-f(b-h))/h return res*h - (db-da)*(h**2)/12 def f(x): return sin(x) a = 0 b = pi/2 exact = 1 print('n\tI\tError') for n in [10, 100, 1000, 10000]: I = m_trapz(f, a, b, n) print('%d\t%.4f\t%.2e' % (n, I, I-exact))arrow_forward
- Please solve using scilab, please add photo of code if possible. Existing answers on Bartleby are incorrect.arrow_forwardWrite a program that asks the user to enter how many students they have. Use a for loop to iterate through each student. For each student, allow the user to enter as many scores as they want and let them know that entering -1 will indicate the end of entering scores( note: use a while loop with sentinel value). Sum all the scores for each student and display the total on the screen . For example: Student 1 Total score is 340 Student 2 Total score is 200arrow_forwardIn java please. thank you!arrow_forward
- Assignment for Computer Architecture You are to write a program in MIPS that computes N! using a loop. Remember N! is the product of all the numbers from 1 to N inclusive, that is 1 x 2 x 3 x (N – 1) x N. It is defined as 1 for N = 0 and is undefined for values less than 0. The program first requests the user to input the value of N (display a prompt first so the user knows what to do). If the input value is less than 0, the program is to display “N! undefined for values less than 0” and request input again. If the value input is non-negative, it is to compute N! using a loop. You are to have your name, the assignment number, and a brief description of the program in comments at the top of your program. Since this is an assembly language program, I expect to see comments on almost every line of code in the program. Also make the code neat (line up the commands and comments in nice columns)arrow_forwardJava code for the following question. Sample output is also given in the 2nd picture do according to the samplearrow_forwardComputer Science The script below demonstrates a very basic loop structure. Indicate the value of R1 after 5 iterations of the loop. (Given the very first line of code, you can assume R1 starts out as 0x00)arrow_forward
- To format output data using format specifiers (for example %3d or %5.2f), we use this method. print printf println outputarrow_forwardUse cin to read integer leftoverValue from input. Then, read the remaining integers from input until 99 is read. For each remaining integer read before 99, if the integer is positive, output the positive integer followed by a newline and subtract the positive integer from leftoverValue. Ex: If the input is: 57 -25 24 20 99 then the output is: 24 20 The total after subtracting all positive values is 13 Note: leftoverValue may go negative. 1 #include 2 using namespace std; 3 4 int main() { 5 6 7 8 9 10 11 12 13} int inputData; int leftoverValue; *Your code goes here */ cout << "The total after subtracting all positive values is " << leftoverValue << endl; return 0;arrow_forwardkotlin langauge print this using loop 1 2 3 2 3 4 5 4 3 ... upto 5 rowsarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY

Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON

Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning

Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning

Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education

Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY