Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Unit 4 Assignment 4: Coding Project (Sequential Search) Scenario You work in a small machine shop and need to write a program that will allow

Unit 4 Assignment 4: Coding Project (Sequential Search)

Scenario

You work in a small machine shop and need to write a program that will allow you to determine if a part is in stock. Create an integer array named partNumbers that will hold part numbers for parts that are in stock. Populate the partNumbers array with these part numbers: 1065, 1095, 1075, 1055, 1056, 1090, 1098, 1088, 1097, and 1078.

Write code that asks the user to enter two part numbers. For Java and C#, use console input. For PHP, create an HTML form with two text fields named Part1 and Part2 and a submit button.

Implement a sequential search function called sequentialSearch() to search the array for the part number entered. Call the function twice and pass the array partNumbers and the variable key for first call and key2 for the second call. Use a variable named array to represent the array passed to the function and an integer variable named element to represent the key value being searched for.

If the part number is found, display to the console the index that part number is in.

The function should return the part number if found, or 1 if not found. Use an integer variable named value to hold the returned value from the function.

Depending on whether or not the part number exists, display to the console that the part number is or is not in stock.

To test your program and get the expected output, enter 1088 for the first value (variable key) and 1067 for the second value (variable key2).

Expected Output

The part number 1088 was found at index 7.

1088 is in stock.

1067 is not in stock.

I am not sure where to even start this assignment (I us C#)

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

More Books

Students also viewed these Databases questions