Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help for this C project ASAP Project Description Write a C (not C++ ) console application (in Visual Studio) that determines whether a

I need help for this C project ASAP image text in transcribedimage text in transcribed

Project Description Write a C (not C++ ) console application (in Visual Studio) that determines whether a data stream is sorted in ascending order. A data stream can be either keyboard or a file. The interface for the program is a command shell's command line. Requirements Your program must handle any length of list (potentially billions!) so your program must work in a 64-bit build. The list will be input (or piped) from the console or read from a file. This is terminated with end-of-stream (^ Z on windows). The output must indicate if the data is sorted by printing the single word 'sorted' on a single line, then return the integer value 101 from main. If the stream is not sorted, you are to print "element \# (value) not sorted" where \# is the offset of the first out-of-order element and value is the value of the unsorted element. In the unsorted case, main must return the integer 100 . Failure to complete the test (bad input, filename, switch) for any reason and the main should return EXIT_FAILURE. If 'help' was selected, main should return EXIT_SUCCESS. The command line arguments Notes 1. You are only expected you perform input with getchar() and scanf(). 2. You are not required to validate that every number is actually the correct type (i.e., you don't have to test for the negative sign if reading natural numbers. 3. You should report if the user entered an invalid switch (e.g., -x)

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

Temporal Databases Research And Practice Lncs 1399

Authors: Opher Etzion ,Sushil Jajodia ,Suryanarayana Sripada

1st Edition

3540645195, 978-3540645191

Students also viewed these Databases questions

Question

Lo6 Identify several management development methods.

Answered: 1 week ago

Question

LO4 List options for development needs analyses.

Answered: 1 week ago