Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Objective: The main objective of this lab activity is to help students to write simple C programs. Part A: a sample pseudocode, flowchart and a

image text in transcribed
image text in transcribed
image text in transcribed
Objective: The main objective of this lab activity is to help students to write simple C programs. Part A: a sample pseudocode, flowchart and a C program Exercise 1: Write a pseudocode or draw a flowchart to print the following lines as shown below: Note: myName and my_field_of_study needs to be replaced by your full name and field of study respectively. The symbols like " and " must be included in the message. Hello! My name is: ** myName ** Field of Study: "my_field_of_study" Thanks :) Exercise 2: Write a C program for the exercise I. Please include all symbols and their proper escape sequences. Exercise 3: Write a C program to display the following asterisk-face pattern: Exercise 4: Write a C program to produce the following table (just printed), using proper escape sequences for spacing between rows and columns: expressionsy=x+3y=x+5resultsy=8y=15 Exercise 5: Write a simple C program that display the following message where myName needs to be replaced by your full name. My name is myName. Exercise 6: Write a C program that using just one printf statement produces the following output. Hello, World! Part B: Input/Output Exereise 7: The following code is getting two integer values from the user and display the sum of them as the output. Each part (AB/C) ) will be modifications to the same program (not three separate programs) to build up the program. A) Change the code to produce the result in the following format (use the escape sequence ta and 't), in which num 1, num 2 and sum should be the actual values of the corresponding variables. Use padding in the numbers (example \%. 7 or %7.2f ) to ensure the box doesn't overflow with larger numbers (test values like 2+2 and 10,000+10,000 ). B) (Continuing on part A) By adding just one statement to the program. display your name and student id in two separate lines as follows before prompting the user to enter first number. myName, Student_ID, Bnter first number: C) (Continuing on part B) Try to update the program such that it stores and prints out the following information as well, placed inside the original box cach of them in a separate line, and test your program with various pair of integer numbers: a. num2 - numl = subtraction b. num I num2 = multiplication c. num 1/ num2 = division EVALUATION: You need to show your GATA the complete pseudocode andfor flowcharts and the C programs during the lab. The marks you will receive for this lab are made of two parts: Lab work marks 8 and attendance marks 2. Total 10 marks. Page 2 of 3 Escape sequences: - In - new line - It tab - I -quote - %% - print a single % padding which include negative symbols, the decimal place, and all numbers. For example, the number 12.567 has 7 total positions. The value of M determines how many positions after the decimal place should be printed. In the same example, %. if will print -12.1 which ignores everthing past the second position. Finally, a negative symbol (ex. \%-N.Mf) will using right-padding instead of the default left-padding

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Structured Search For Big Data From Keywords To Key-objects

Authors: Mikhail Gilula

1st Edition

012804652X, 9780128046524

More Books

Students also viewed these Databases questions