0

I don't understand the code, how does it work?

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SoloLearn { class Program { static void Main(string[] args) { int maxBid = Convert.ToInt32(Console.ReadLine()); //your code goes here int bid = int.Parse(Console.ReadLine()); while(bid < maxBid) { bid=int.Parse(Console.ReadLine()); } Console.WriteLine("Sold: " + bid); } } }

6th Jun 2022, 1:43 PM
RAMADAN : رمضان
RAMADAN : رمضان - avatar
5 Antworten
+ 1
It allows you enter 2 integer values in separate lines maxBid, bid until bid < maxBid, you can again enter values into bid What lines you not understood? Hope it helps..
6th Jun 2022, 1:49 PM
Jayakrishna 🇮🇳
+ 1
int.Parse( argument ) parses the argument to an integer value and returns the value. It's almost same as Convert.ToInt32(argument);
6th Jun 2022, 4:40 PM
Jayakrishna 🇮🇳
0
the question:We create an auction program with maximum bids set. The number of bids is variable. Write a program to take the maximum bid as input, then take all bids from the auction participants until the maximum is exceeded To view the quote The program must output the corresponding letter with the winning bid. I did not understand the question well
6th Jun 2022, 2:03 PM
RAMADAN : رمضان
RAMADAN : رمضان - avatar
0
Take a sample : First input is maxBid = 1000 Next you can input bids until exceed maxBid. Then it will sold to your max bid maxBid = 1000 200 300 400 500 700 900 1200 here bid<maxBid 1200<1000 is false. You can output sold to 1200 Question is implement code for this. Hope I understood your question correctly.. and hope your code qualifies... Because iam checked it. Hope it helps...
6th Jun 2022, 2:20 PM
Jayakrishna 🇮🇳
0
Jayakrishna🇮🇳 I'm still having a hard time understanding the code now what it means: "int.parse"
6th Jun 2022, 3:51 PM
RAMADAN : رمضان
RAMADAN : رمضان - avatar