
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
Code in C linux
Add comments

Transcribed Image Text:Program Name
Description
The program will add the values of all the integer digits between the integer given by the
user and the integer that is twice the integer entered.
.
Requirements
Create the c program using sumTimes2.c in the p04/ex1 directory. Using the format and
words displayed in the Example of Output, the program will do the following:
• Display a the welcome message followed by a blank line
Displays a message that indicates what the program will do followed by a blank line.
Asks the user for and receive an integer (called daNumba)
Using the integer the program will call the sumFor function and then the sumWhile
function. These functions will both sum the values from daNumba to (daNumba * 2) if
daNumba is positive. If daNumba is not positive it will add the values from (daNumba
*2) to daNumba. Both functions will receive the value of daNumba and return a the
summed value. The only difference between the 2 functions is that sumFor will only use
for loops and sumWhile will only use while loops.
CIS158 Programming Assignment - P04
Line Word Character Count & Sum Times
sumTimes2
• A blank line.
.
•
.
.
Display the message indicating the value returned by sumFor
A blank line
Display the message indicating the value returned by sumwhile
• A blank line.
Ends with a thank you message.

Transcribed Image Text:CIS158 Programming Assignment - P04
Line Word Character Count & Sum Times
Example of Output (user input is in blue)
Welcome to sumTimes2.
This program will sum the integers between the one you enter a the
integer that is twice that value
Please enter your integer: 3
For says the sum is 18
While says the sum is 18
Thank you for using sumTimes2. Bye!
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 2 steps with 1 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-science and related others by exploring similar questions and additional content below.Similar questions
- In C, what is a pipe?arrow_forwardIn creating C++ applications, you have the ability to utilize various formatting functions in the iostream library. What are some of the formatting vulnerabilities that can be encountered in using the iostream library in C++? What tips can be utilized to identify these vulnerabilities? Be sure to provide an appropriate source code example to illustrate your points.arrow_forwardTrying to update a C++ code I wrote earlier (perhaps around 30-60 lines of code) and make it compile and run showing how to use: Note: I am currently working on using class. I am not commited to the below code, just looking for a job example to help me understand the concepts better and how to clean up my own code to be more effiecent using the current items I am reading about. I would like to stay using the address example though. Please label code to help me understand as I break it down. a. abstract data type b. const c. class constructor #include <iostream>#include <string> using namespace std; class address // address structure type{public:string streetAddress;string city;string state;int zipcode; }; int main() { address guest; // class address named guest address home; // class adress named home and inputshome.streetAddress = "1234 Right Way Rd.";home.city = "Huntsville";home.state = "AL";home.zipcode = 35803; cout << "What is your address?…arrow_forward
- C Programming. Could you update my code using the code I provided. I need help with 6. #include <stdio.h>#include <stdlib.h> #define TRUE 1#define FALSE 0#define NAME 20#define ROW 8#define COL 8#define SPACE ' '#define PLAYER_X 1#define PLAYER_O 2#define ZERO 0#define ONE 1#define TWO 2#define FOUR 4#define INVALID -1 // function prototypesvoid welcomeScreen ();void displayExplicitBoard();void clearScreen();void playGame(); // main functionint main(){ // call function welcomeScreen welcomeScreen(); // call function clearScreen clearScreen(); // call function displayExplicitBoard// displayExplicitBoard(); // call function playGame playGame(); // program executed successfully return 0;} // welcomeScreen function displays the Othello logo and rules of the gamevoid welcomeScreen (){ printf ("\t\t OOOO TTTTTT HH HH EEEEEE LL LL OOOO \n"); printf ("\t\tOO OO TT HH HH EE LL LL OO OO \n"); printf ("\t\tOO…arrow_forwardC PROGRAMMING. using the following program as a start point: /* * NetworkServer.c * ProgrammingPortfolio Skeleton * */ /* You will need to include these header files to be able to implement the TCP/IP functions */#include <stdio.h>#include <stdlib.h>#include <string.h>#include <sys/types.h>#include <netinet/in.h>#include <netdb.h>#include <fcntl.h>#include <unistd.h>#include <errno.h>#include <sys/socket.h> /* You will also need to add #include for your graph library header files */ int main(int argc, const char * argv[]){ int serverSocket = -1; printf("Programming Portfolio 2022 Implementation\n"); printf("=========================================\n\n"); /* Insert your code here to create, and the TCP/IP socket for the Network Server * * Then once a connection has been accepted implement protocol */ TASK: you are to write a TCP/IP server that can build up a graph of a network ofnetworks…arrow_forwardFor this C Program, I am getting the error "Expected an identifier" on line 18.arrow_forward
- I need help making this program in C programming. Please look at the pictures provided at that helps. Thank You!arrow_forward/***************************************************************************** * Online C Compiler.Code, Compile, Run and Debug C program online. Write your code in this editor and press "Run" button to compile and execute it. ****************************************************************************** */ #include <stdio.h> int main() {int e=1; while(e) { int n;puts("please enter a positive integer value (betweenn 1 and 7, inclusive)"); scanf("%d",&n);if (n>7)puts("Invalid input");else if (n<=0)puts("Invalid input");else{ long fact=1; float sum=0; int i=1; while (i<=n) {fact=fact*(i+1); sum= sum +(1.0/fact); if (i<n) printf("1/%ld+",fact); else printf("1/%ld=",fact); i++; } printf("%.3f\n",sum); } puts("Do you want to try again? 1/yes, 0/no"); int answer;scanf("%d",&answer);if (answer==0) e=0; } puts("Goodbye!"); return 0; }arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education