-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOOP_2020 Q4-a.cs
More file actions
40 lines (40 loc) · 1.21 KB
/
Copy pathOOP_2020 Q4-a.cs
File metadata and controls
40 lines (40 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using System;
using System.Collections.Generic;
using System.Text;
namespace program
{
public class Program
{
static void Main(string[] Args)
{
int[] id = new int[1000];
int[] price = new int[1000];
int[] quantity= new int[1000];
for (int i = 0; i < 1000; i++)
{
Console.WriteLine("Enter {0} id", (i + 1));
id[i] = int.Parse(Console.ReadLine());
Console.WriteLine("Enter {0} price", (i + 1));
price[i] = int.Parse(Console.ReadLine());
Console.WriteLine("Enter {0} quantity", (i + 1));
quantity[i] = int.Parse(Console.ReadLine());
}
Console.WriteLine("Less than 10 pieces : ");
for (int i = 0; i < 1000; i++)
{
if (quantity[i] < 10)
{
Console.Write(id[i] + " ");
}
}
Console.WriteLine("More than 500$ : ");
for (int i = 0; i < 1000; i++)
{
if (price[i] > 500)
{
Console.Write(id[i] + " ");
}
}
}
}
}