Assignment 5 For this assignment, you'll be given three arrays where one represents the item numbers, a second contains the item descriptions, and the third represents the price of the item. For instance, index 3 in the items array will have the corresponding description for the item in index 3 of the descriptions array and the price for the item in index 3 of the price array. You'll ask the user which item to lookup, search the array for the item, and print the description and price when the item is found. When the item was not found, print, Item not found. Data Arrays int[] items=45, 70, 94, 20, 19, 50, 38, 46 }; string[] descriptions = { "Book", "Keyboard", "Earbuds", "Mouse", "Video Game", "Bag of Coffee", "Fancy Mug", "Pie"); double [] prices = {21.17, 47.29, 27.29, 26.46, 47.80, 7.82, 44.52, 3.14 ); Sample When an item exists: Enter an item number. 50 Price for Bag of Coffee is $7.82 When item doesn't exist: Enter an item number. 33 Item not found
Assignment 5 For this assignment, you'll be given three arrays where one represents the item numbers, a second contains the item descriptions, and the third represents the price of the item. For instance, index 3 in the items array will have the corresponding description for the item in index 3 of the descriptions array and the price for the item in index 3 of the price array. You'll ask the user which item to lookup, search the array for the item, and print the description and price when the item is found. When the item was not found, print, Item not found. Data Arrays int[] items=45, 70, 94, 20, 19, 50, 38, 46 }; string[] descriptions = { "Book", "Keyboard", "Earbuds", "Mouse", "Video Game", "Bag of Coffee", "Fancy Mug", "Pie"); double [] prices = {21.17, 47.29, 27.29, 26.46, 47.80, 7.82, 44.52, 3.14 ); Sample When an item exists: Enter an item number. 50 Price for Bag of Coffee is $7.82 When item doesn't exist: Enter an item number. 33 Item not found
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
Hello, I need help with this assignment, I have to use # C language for it and I doing it on Visual Studio. I am really confused about how to do the arrays for this. I have tried to do the assignment which is in the image I added, but all the number items kept saying they are 3.14 for price when the items are all supposed to have unique prices. I also need help with putting the descriptions in the array like "book"likw with the example at the bottom of Assignemnt 5 page. Thank you for the help.
![Class1.cs X
C# Assignment 5
Id
45%
7
a
using System;
using System.Reflection Metadata;
using System.Threading.Tasks;
using System. Transactions;
using static System.Console;
namespace Assignment 5
{
c
-class MainClass
{
▼ 2
diference
static void Main()
-int[] itens (45, 90, 94, 20, 19, 50, 38, 46);
string[] descriptions { "Book", "Keyboard", "Earbuds", "House",
"Video Game", "Bag of Coffee", "Fancy Hug", "P");
double[] prices (21.17, 47.29, 27.29, 26.46, 47.80, 7.32, 44.52, 3.14);
int itendrdered;
double itemPrice = 0;
bool islten false;
Write("Enter-iten number please");
iteOrdered Convert.Toint32(ReadLine());
far(int x=0; x<itas.Length; ++)
if (itemürdered -- items[x]);
-if(isiton)
{
1
isiten true;
itemPriceprices[x];
WriteLine("Price is (0)", itemPrice);
دماء
WriteLine("Its not found");
Output
Show output from:
0
A 1
Assignment_5.MainClass
ab-
Ⓒ
Main()
Ln: 32
Ch: 135
SPC
CRLF
- д х
Notifications](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fba41e575-c5d0-4975-9a43-fb5589c88b38%2F60cba889-6884-4b93-9ae3-2cb4b8c2dc7b%2F8knkqrm_processed.png&w=3840&q=75)
Transcribed Image Text:Class1.cs X
C# Assignment 5
Id
45%
7
a
using System;
using System.Reflection Metadata;
using System.Threading.Tasks;
using System. Transactions;
using static System.Console;
namespace Assignment 5
{
c
-class MainClass
{
▼ 2
diference
static void Main()
-int[] itens (45, 90, 94, 20, 19, 50, 38, 46);
string[] descriptions { "Book", "Keyboard", "Earbuds", "House",
"Video Game", "Bag of Coffee", "Fancy Hug", "P");
double[] prices (21.17, 47.29, 27.29, 26.46, 47.80, 7.32, 44.52, 3.14);
int itendrdered;
double itemPrice = 0;
bool islten false;
Write("Enter-iten number please");
iteOrdered Convert.Toint32(ReadLine());
far(int x=0; x<itas.Length; ++)
if (itemürdered -- items[x]);
-if(isiton)
{
1
isiten true;
itemPriceprices[x];
WriteLine("Price is (0)", itemPrice);
دماء
WriteLine("Its not found");
Output
Show output from:
0
A 1
Assignment_5.MainClass
ab-
Ⓒ
Main()
Ln: 32
Ch: 135
SPC
CRLF
- д х
Notifications
![Assignment5.pdf
Pages Bookmarks
1
<
Assignment 5
1 / 1
Data Arrays
TT
For this assignment, you'll be given three arrays where one represents the item numbers, a second
contains the item descriptions, and the third represents the price of the item. For instance, index 3 in
the items array will have the corresponding description for the item in index 3 of the descriptions array
and the price for the item in index 3 of the price array. You'll ask the user which item to lookup, search
the array for the item, and print the description and price when the item is found. When the item was
not found, print, Item not found.
Sample
W
int[] items = { 45, 70, 94, 20, 19, 50, 38, 46 };
string[] descriptions = { "Book", "Keyboard", "Earbuds",
"Video Game", "Bag of Coffee", "Fancy Mug", "Pie"};
double [] prices = {21.17, 47.29, 27.29, 26.46, 47.80, 7.82, 44.52,
3.14 };
When an item exists:
Enter an item number. 50
Price for Bag of Coffee is $7.82
When item doesn't exist:
Enter an item number. 33
Item not found.
"Mouse",
T
0₁
12.0
X
:](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fba41e575-c5d0-4975-9a43-fb5589c88b38%2F60cba889-6884-4b93-9ae3-2cb4b8c2dc7b%2Fw88jydb_processed.png&w=3840&q=75)
Transcribed Image Text:Assignment5.pdf
Pages Bookmarks
1
<
Assignment 5
1 / 1
Data Arrays
TT
For this assignment, you'll be given three arrays where one represents the item numbers, a second
contains the item descriptions, and the third represents the price of the item. For instance, index 3 in
the items array will have the corresponding description for the item in index 3 of the descriptions array
and the price for the item in index 3 of the price array. You'll ask the user which item to lookup, search
the array for the item, and print the description and price when the item is found. When the item was
not found, print, Item not found.
Sample
W
int[] items = { 45, 70, 94, 20, 19, 50, 38, 46 };
string[] descriptions = { "Book", "Keyboard", "Earbuds",
"Video Game", "Bag of Coffee", "Fancy Mug", "Pie"};
double [] prices = {21.17, 47.29, 27.29, 26.46, 47.80, 7.82, 44.52,
3.14 };
When an item exists:
Enter an item number. 50
Price for Bag of Coffee is $7.82
When item doesn't exist:
Enter an item number. 33
Item not found.
"Mouse",
T
0₁
12.0
X
:
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education