?
Solved

ARRAYS

Posted on 2000-05-08
7
Medium Priority
?
328 Views
Last Modified: 2010-04-02
Hi

I have to write a program involving arrays and am having trouble figuring out where to start.  Here it is, if you could please give me your opinion on how to write it, that would be great, thanks:

Cars have been tested with A-E(good through bad) for how the preformed.  The are in a file called inData.
INPUT:
read the input data from file inData.  The first data line contains the key to the standards.  For example, if a certain character position contains an "A", then every vehicle must receive an "A" rating for the corresponding test, or be rejected.

The test letters are the first 30 characters, and the are followed by an integer number that indicated how many vehicles were tested(n).
The next n lines contain test results for various vehicles in the first 20 character positions, followed by the vehicles registration/license ID in the next (up to) 8 character positions.

OUTPUT:
for each vehicle, output the reg/lic ID, followed by PASSED if the vehicle satisfies all tests, or FAILED if any of the test results dont meet standards.  For failed ones, shoe the number of each failed test, the required result and the actual result should also be printed.

EXAMPLE INPUT FILE

cccdacccddbacbbcaccccccaadbbcc CAR1
abddacccddbacbbcaccccccaadbbcc CAR2
aaadacccddbacbbcaccccccaadbbcc CAR3
adadccccddbacbbcaccccccaadbbcc CAR4

EXAMPLE OUTPUT

CAR2   FAILED
      Test 3 required C Actual D
CAR3 PASSED
CAR4 FAILED
      Test 2 Required C Actual D
      Test 5 Required A Actual C

IT ISNT HOMEWORK!!!!!!!!!
0
Comment
Question by:the_dude
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 1

Expert Comment

by:ntdragon
ID: 2789990
we don't answer to homework questions
ask a direct QUESTION and send us your code or your ideas and we will try to help we can't do it for you
0
 
LVL 2

Accepted Solution

by:
alcindor earned 200 total points
ID: 2789996
This problem can be solved by first providing an analysis in structured english and then coding in the language of your choice. eg :-
( allowing for your typing errors !)

1 - read in the first line and set up an array representing the pass level for each test.(pass level array)

2 - for each car perform the following operations

a) read the test results into an array (test results array) and the car registration into a temporary variable ( eg car_reg)

b) compare each element of the pass level array with the test results array and count the number of "failures"

c) if there are no failures then display the PASS message, otherwise display the FAIL message and repeat step b) above, this time displaying the test results that failed.

If this is a school assignment then you should not post the question on experts exchange.

Roger
0
 
LVL 6

Expert Comment

by:Talmash
ID: 2791348
good luck with your home-work .

what about the exam ?

can you send questions trough e.e.
durring an exam ?!
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:the_dude
ID: 2793365
it isnt homework!!!!!
0
 

Author Comment

by:the_dude
ID: 2793405
Edited text of question.
0
 

Author Comment

by:the_dude
ID: 2793408
Edited text of question.
0
 

Author Comment

by:the_dude
ID: 2795456
thanks for almost beliving me, it really wasnt homework, everyone, including u thought it was, thanks for helping though
0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question