
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
C program:
Please write a program with call to functions to produce the output given below:
***********************************************
* MENU – Final Exam *
* (1) Calling displayOddDigitInfo() *
* (2) Quit *
***********************************************
Enter an integer for option + ENTER: 6
Wrong Option!
* MENU – Final Exam *
* (1) Calling displayOddDigitInfo() *
* (2) Quit *
***********************************************
Enter an integer for option + ENTER: 6
Wrong Option!
***********************************************
* MENU – Final Exam *
* (1) Calling displayOddDigitInfo() *
* (2) Quit *
***********************************************
Enter an integer for option + ENTER: 1
Enter an integer: -294257
Calling displayOddDigitInfo() with argument of -294257 -
While displayOddDigitInfo() is running –
-294257 is negative and odd!
-294257 has 3 odd digits of
7
5
9
* MENU – Final Exam *
* (1) Calling displayOddDigitInfo() *
* (2) Quit *
***********************************************
Enter an integer for option + ENTER: 1
Enter an integer: -294257
Calling displayOddDigitInfo() with argument of -294257 -
While displayOddDigitInfo() is running –
-294257 is negative and odd!
-294257 has 3 odd digits of
7
5
9
***********************************************
* MENU – Final Exam *
* (1) Calling displayOddDigitInfo() *
* (2) Quit *
***********************************************
Enter an integer for option + ENTER: 1
Enter an integer: -25904
Calling displayOddDigitInfo() with argument of -25904 -
While displayOddDigitInfo() is running –
-25904 is negative and even!
* MENU – Final Exam *
* (1) Calling displayOddDigitInfo() *
* (2) Quit *
***********************************************
Enter an integer for option + ENTER: 1
Enter an integer: -25904
Calling displayOddDigitInfo() with argument of -25904 -
While displayOddDigitInfo() is running –
-25904 is negative and even!
***********************************************
* MENU – Final Exam *
* (1) Calling displayOddDigitInfo() *
* (2) Quit *
***********************************************
Enter an integer for option + ENTER: 1
Enter an integer: 0
Calling displayOddDigitInfo() with argument of 0 -
While displayOddDigitInfo() is running –
0 is an even integer!
At least, your program should have and use the following functions,
displayCodingStatement()
displayClassInfo()
runMenuFinalExam()
displayOddDigitInfo()
---THE END---
Thank you so much!
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 4 steps with 5 images

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-engineering and related others by exploring similar questions and additional content below.Similar questions
- Function SecondsToMinutes(float totalSecs) returns float resultMins // Calculate resultMins: resultMins = 0 Function Main() returns nothing float userSecs float resultMins userSecs = Get next input resultMins = SecondsToMinutes(userSecs) Put userSecs to output Put " seconds are " to output Put resultMins to output Put " minutes." to outputarrow_forward**C programming language *please provide comments **Exo in picturearrow_forwardThe following function has errors. Locate as many errors as you can. // Overloaded functions int getValue(){ int inputValue; cout << "Enter an integer: "; cin >> inputValue; return inputValue; } double getValue() { double inputValue; cout << "Enter a floating-point number: "; cin >> inputValue; return inputValue;}arrow_forward
- Program Structure /*** SAMPLE PROGRAM *** Header Block This program computes the distance between two points. *********************************** ***** /**** * Preprocessor directives */ #include #include Preprocessor Directives * Main function */ int main(void) Declarations /* Declare variables */ double x1=1, yl=5, x2=4, y2=7, sidel, side2, distance; * Compute sides of triangle and distance */ sidel = x2-x1; side2 = y2-y1; distance = sqrt(sidel*sidel + side2*side2); Main Function Statements * Print distance */ printf("Distance = %5.2f\n",distance); * Exit program */ Return Statement return 0; ***** /******************** Program Bodyarrow_forward****Microsoft Visual Studios (C++)**** Write a program that will do the following: Run continuously until the user gives a command to quit Ask the user if they want to calculate the area of a circle, square, or triangle. Based on response will ask the user for the appropriate quantities then display the area to the user.arrow_forwardint x1 = 66; int y1 = 39; int d; _asm { } mov EAX, X1; mov EBX, y1; push EAX; push EBX; pop ECX mov d, ECX; What is d in decimal format?arrow_forward
- Please fill in the blanks. /* This function asks for 2 strings from the user and asks the user to choose what they want to do with them. Inputs: 2 strings, and a character for choice. Output: execute that choice. Choices can be: 'E'/'e': call checkEqual() function 'C'/'c': call concatStrings() function Everything else: invalid and exit */ #include<__1__> //library to use printf and scanf #include<__2__> //library to use boolean #include<__3__> //library to use exit(0) #define len 1000 /*This function just concatenates 2 strings using a */ __4__ concatStrings(__5__ w1[], __6__ w2[], __7__ w3[]) { int w3_idx = 0; //index for w3 //Copy word1 w1 over to the combined string for(int i = 0; __8__ != __9__; i++) //loop runs as long as string is not done { __10__[__11__] = __12__[__13__]; //copy a character from w1 to w3 w3_idx++; //update…arrow_forwardModule/Week 2 ASSIGNMENT (INPUT/OUTPUT)The number of permutations of a set of n items taken r at a time is given by the following formulan !⁄r !(n-r)!: where n! is the factorial of n, r! is the factorial of r, and (n-r)! is the factorial of the result of n-r. The factorial of a number n can be solved using the following formula: 〖n!=e〗^(-n) n^n√2πn. If there are 18 people in your class and you want to divide the class into programming teams of 3 members, you can compute the number of different teams that can be arranged using this formula (n !⁄r !(n-r)!). Write a C++ program that determines the number of potential team arrangements. You will need to use the double type for this computation. Use the Lab Template you set-up last week, proper formatting, and appropriate comments in your code. The output must be labeled clearly and formatted neatly. Submit C++ Programming Assignment 2 by 11:59 p.m. (ET) on Monday of Module/Week 2.arrow_forwardCan anyone help me these coding questionsarrow_forward
- Code so far is this. // @brief Program 1 - ASCII Building// REPLACE ME AND THE LINES AROUND ME!// Adapted from prior programs developed by Professor Reed. /* Running the program looks like:Choose from among the following options:1. Exit the program2. Display buildingYour choice -> 1*/ #include <iostream> // for cin and cout#include <iomanip> // for setw() and setfill()using namespace std; // so that we don't need to preface every cin and cout with std:: void printFirstTwoBuildingSection(int n, int startSpacing){int start = n / 2, end = 0;if (n <= 2){start = 0;}for (int i = 0; i < n; i++){for (int j = 0; j < startSpacing; j++){cout << " ";}cout << "|";if (i < (n / 2)){for (int k = 0; k < i; k++){cout << " ";}cout << "\\";for (int k = 0; k < start; k++){cout << " ";}cout << "/";start -= (n / 2);for (int k = 0; k < i; k++){cout << " ";}cout << "|" << endl;}else{for (int k = n - i - 1; k > 0;…arrow_forwardQ in picture **C PROGRAMMING LANGUAGE ***PROVIDE COMMENTSarrow_forwardFill-in-the-Blank If function showValue has the following header: void showValue(int quantity) you would use the statement _________ to call it with the argument 5.arrow_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