Compdateoracle is a perfect function

Assignment Help C/C++ Programming
Reference no: EM131121654

Question:
David needs to test a function that compares dates (in C) with the following specification:
/* returns 0 if date1 = date2, -1 if date1 before date2, 1 if date1 after date2,
-2 if any element of any date is invalid;
valid years are all integers (<0 = BC); valid month is 1-12; valid day is
1-{28,29,30,31} depending on the year and month */
intcompdate(int year1, int month1, int day1, int year2, int month2, int day2);

He proposes a random testing scheme, running 2,000,000 tests where each test is
performed by the following function:

intoneTest() {
int y1 = random_int(); /* returns a random 32 bit value */
int y2 = random_int();
int m1 = (random_int() % 11) + 1;
int m2 = (random_int() % 11) + 1;
int d1 = (random_int() % 30) + 1;
int d2 = (random_int() % 30) + 1;
int c1 = compdate(y1,m1,d1,y2,m2,d2);
Assert(c1 == c2, "Issue with compdate function");
}

Assuming that compdateOracle is a perfect function without any bug to compare dates, Find out 3 issues with this random testing scheme. For each of the issue found, propose an improvement. Mention issue in one line and improvement proposal in less then 3 lines. Find out logical issue, don't look for typos and coding errors.

Reference no: EM131121654

Questions Cloud

Changes about taco bell product and service mix : Changes about Taco Bell product and service mix, explain why they are (or are not) significant in this particular situation and The selling points (benefits) associated with each change or addition to Taco Bell’s mix ?
What were its comparative advantages : In the Bible, read about the city of Tyre in Ezekiel 27. Tyre is judged and eventually destroyed, and the prophecy of Ezekiel is thought to have been fulfilled by Alexander the Great. Tyre was a very wealthy trading city. Do some research and learn a..
Database architecture and design : Database architecture and design Data dictionaries, data modeling, data mining, and data warehouses Characteristics of data quality and data integrity
The social environment that create an atmosphere : Identify and explain the major factors in the social environment that create an atmosphere in which business criticism takes place and prospers. How are the factors related to one another? Has the revolution of rising expectations run its course? ..
Compdateoracle is a perfect function : CompdateOracle is a perfect function without any bug to compare dates, Find out 3 issues with this random testing scheme. For each of the issue found, propose an improvement. Mention issue in one line and improvement proposal in less then 3 lines. Fi..
Organization voluntary efforts to nurture diversity : How does diversity differ from EEO and affirmative action? Give examples. Tell us about your knowledge/experiences with an organization’s voluntary efforts to nurture diversity. Tell us about your knowledge/experiences with an organization’s EEO and/..
What are the major key players on the international side : What are the major key players on the international side? All of the following are true regarding the FASB Codification except. Accounting principles are "generally accepted" only when.
Economies of scale in a supply chain cycle inventory : As an inventory quality manager at a major big box retailer, you have been tasked to reduce the lot size of products from a major supplier. a) Discuss which costs are expected to change. b)Your boss has tasked you to achieve the objective of lot s..
Examine processing services offered and fees charged : Evan Moskowitz has formed an Internet training company called Teach-U-Comp to sell computer programming courses online. Each course costs $65, and students receive continuing education units (CEUs) based on the duration of the course and its level of..

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Write program that user ask to enter floating point numbers

Write the following program: The user is asked to enter 2 floating point numbers (use doubles). The user is then asked to enter one of the following mathematical symbols: +, -, *, or /.

  Question 1the figure given is an example of select onea

question 1the figure given is an example of select onea. class adapter pattern b. observer pattern c. composite

  Length and the property line

Find the area, in acres, of the property shown in the figure below. The stream frontage is 141 feet in length and the property line is 500 feet in length. Round to two decimal places

  A constructor that constructs a rectangle2d

A constructor that constructs a Rectangle2D with specified points as coordinates.A no-argument constructor that creates the rectangle with points (0, 0), (5, 5) and (0, 5) and

  Displays a table showing the price of silver and gold

Write a C++ program that displays a table showing the price of silver and gold. The table will have three columns. The first column will be labeled Ounces, the second labeled Silver, and the third labeled Gold.

  Design a system using a class called books

Design a system using a class called Books with suitable members

  Programming questions

Derive a class Programmer from Employee. Supply a constructor Programmer(string name, double salary) that calls the base-class constructor. Supply a function get_name that returns the name in the format "Hacker, Harry (Programmer)".

  Develop a class event to model events scheduled

After all the events have been entered, the program should display a schedule of events in chronological order. Attached are the program files for structure/class and sorting. I need in c++ hide problem

  Research paper on dynamic arrays

Create codes for the following problem/s. Compile, test run, and edit them if necessary. Include your original .cpp and related file(s) (if any) in a single folder. Compress (zip) the folder and submit the single zipped folder.

  Local resturant automate its breakfast billing system

Use an array , menuList, of the struct menuItemType. use an array, menuList, of the struct menuItemType. your program must contain at least the following functipons : your program must contain at least the following functipons.

  Calculate the percentageand & add the percentage to a total

I need to declare 3 arrays. The first array will hold the employee ID. The second array will hold the amount of sales for that employee. Finally, the third array will hold the percentage of sales for each employee.

  Use a loop in main to efficiently handle all three persons

Plan and finish writing the main program, and all the functions, including a constructor. Use a loop in main to efficiently handle all three persons' data.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd