logo Use CA10RAM to get 10%* Discount.
Order Nowlogo
(5/5)

You will be developing several functions for this milestone. The unit tester in the file “a1ms1.c” assumes

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

Preparation

Download or clone the Assignment 1 from GitHub.

 

In the directory: A1/MS1 you will find the Visual Studio project files ready to load. Open the project (a1ms1.vcxproj) in Visual Studio.

 

Note: the project will contain only one source code file which is the main tester “a1ms1.c”.

 

Milestone – 1 (Code: weight 2.5%) 

 

Milestone-1 includes a unit tester (a1ms1.c). A unit tester is a program which invokes your functions, passing them known parameter values. It then compares the results returned by your functions with the correct results to determine if your functions are working correctly. The tester should be used to confirm

 

your solution meets the specifications for each “helper” function. The helper functions should be thoroughly tested and fail-proof (100% reliable) as they will be used throughout your assignment milestones.

Development Suggestions

 

You will be developing several functions for this milestone. The unit tester in the file “a1ms1.c” assumes

these functions have been created and, until they exist, the program will not compile.

 

Strategy – 1

You can comment out the lines of code in the “a1ms1.c” file where you have not yet created and defined the referenced function. You can locate these lines in the function definitions (after the main function) and for every test function, locate the line that calls the function you have not yet developed and simply comment the line out until you are ready to test it.

 

Strategy – 2

You can create “empty function shells” to satisfy the existence of the functions but give them no logic until

you are ready to program them. These empty functions are often called stubs.

 

Review the specifications below and identify every function you need to develop. Create the necessary function prototypes (placed in the .h header file) and create the matching function definitions (placed in the .c source file), only with empty code blocks (don’t code anything yet). In cases where the function MUST return a value, hardcode (temporarily until you code the function later) a return value so your application can compile.

Specifications

 

Milestone-1 will establish the function “helpers” we will draw from as needed throughout the three milestones. These functions will handle routines that are commonly performed (greatly reduces code redundancy) and provide assurance they accomplish what is expected without fail (must be reliable).

 

Core Module

 

1. Create a module called “core”. To do this, you will need to create two files: “core.h” and “core.c” and

add them to the Visual Studio project.

2. The header file (.h) will contain the function prototypes, while the source file (.c) will contain the function definitions (the logic and how each function works).

Copy and paste the commented section provided for you in the a1ms1.c file (top portion) to all files you create

Fill in the information accordingly

3. The “core.c” file will require the usual standard input output system library as well as the new user

library “core.h”, so be sure to include these.

4. Review the “a1ms1.c” tester file and examine each defined tester function (after the main function).

Each tester function is designed to test a specific helper function.

5. Two (2) functions are provided for you. Here are the function prototypes you must copy and place into

the “core.h” header file:

 

 

 

 

 

Functions

The source code file “core.c” must contain the function definitions (copy and place the function

definitions below in the “core.c” file):

 

 

 

6. Each function briefly described below will require a function prototype to be placed in the “core.h” file,

and their respective function definitions in the “core.c” file.

The function identifiers (names) are provided for you however you are responsible for constructing the full function prototype and definitions based on the descriptions below (there are six (6) functions in total):

 

Function: inputInt This function must:

o return an integer value and receives no arguments.

o get a valid integer from the keyboard.

o display an error message if an invalid value is entered (review the sample output for the appropriate error message)

o guarantee an integer value is entered and returned.

o Hint: You can use scanf to read an integer and a character ("%d%c") in one call and then assess if the second value is a newline character. If the second character is a newline (the result of an <ENTER> key press), scanf read the first value successfully as an integer.

 

o If the second value (character) is not a newline, the value entered was not an integer or included additional non-integer characters. If any invalid entry occurs, your function should call the clearInputBuffer function, followed by displaying an error message and continue to prompt for a valid integer. Review the flowchart below that describes this process.

 

 

(5/5)
Attachments:

Related Questions

. Introgramming & Unix Fall 2018, CRN 44882, Oakland University Homework Assignment 6 - Using Arrays and Functions in C

DescriptionIn this final assignment, the students will demonstrate their ability to apply two ma

. The standard path finding involves finding the (shortest) path from an origin to a destination, typically on a map. This is an

Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t

. Develop a program to emulate a purchase transaction at a retail store. This program will have two classes, a LineItem class and a Transaction class. The LineItem class will represent an individual

Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th

. SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

. Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Um e HaniScience

951 Answers

Hire Me
expert
Muhammad Ali HaiderFinance

736 Answers

Hire Me
expert
Husnain SaeedComputer science

957 Answers

Hire Me
expert
Atharva PatilComputer science

578 Answers

Hire Me