Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Language C #include // Macro definitions #define COURSE_NUMBER cosc1320 #define COURSE_NAME C Programming // main function definition. Program execution begins here. int main(void) { //

Language C

image text in transcribedimage text in transcribedimage text in transcribed #include  // Macro definitions #define COURSE_NUMBER "cosc1320" #define COURSE_NAME "C Programming" // main function definition. Program execution begins here. int main(void) { // Output statement to display the words "Hello, World!" puts("Hello, World!"); // Print just a new line, to create a blank line after "Hello, World!" printf(" "); // Display course name and number, utilizing the previously defined macros. // Note two newline characters, to create a blank line before the exit prompt. printf("%s - %s ", COURSE_NUMBER, COURSE_NAME); system("pause"); return 0; } 
This lab will introduce you to the basics of writing C programs, and give you an opportunity to start experimenting with console output. We'll be using printf and its variations a lot this semester, so I want you to get familiar with the variety of ways we can build valid output statements. Sample Program The sample program this week is a slightly modified version of the basic HelloWorld.c that we saw in the demo video and lecture slides. Download the file, add it to a project, and spend some time introducing errors and playing around with it. Once you are satisfied, remove the file from your project, create a new source file and begin the lab as described below. Your Program Write a short C program to display your name, the date, and the name of the course. In order to encourage you to use a variety of output options, I'd like the formatting to be as follows (the lines below refer to the output, not your source code): The first line should include a prompt, "Name: " followed by your full name. o Your name should be efined in a macro named FULLNAME and displayed using the appropriate printf0 format specifier. The second line should include a prompt, "Date: "followed by the current date as MM/DD/MY o The integer value for the month, day, and year should be defined in macro values named MONTH, DAY, and YEAR. Print out the entire date, with the slashes separating components, in a single printf) statement. The third line should be blank. . The fourth line should read "COSC 1320 - C Programming The fourth line should read "COSC 1320 - C Programming o Use a puts0 statement instead of a printf) statement for this line. The fifth line should be blank. The sixth line should be blank. The seventh line should be the "Press any key to continue..." prompt, as generated by the system("pause") command at the end of your program. . This formatting can be seen in the sample output screenshot below. When you are done writing and testing your code, and are satisfied with the results, please submit the final .c file through the Blackboard submission tool. Name your source file according to the following convention: [First Initial][Last Namel Lab1.c. For instance, my submission would be LSilcoxLab1. Output Screenshots Name: Lucian Silcox Date: 1/27/2019 COSC 1320 - C Programming Press any key to continue

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_2

Step: 3

blur-text-image_3

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

Managing Your Information How To Design And Create A Textual Database On Your Microcomputer

Authors: Tenopir, Carol, Lundeen, Gerald

1st Edition

1555700233, 9781555700232

More Books

Students also viewed these Databases questions

Question

Complexity of linear search is O ( n ) . Your answer: True False

Answered: 1 week ago