🔒 Closed Solved. Salamat po

Status
Not open for further replies.

Maginaku

Honorary Poster
Pa help naman po nito about stack po pa check at patama naman po ng gawa ko eto po code at yung directions.
 

Attachments

  • Screenshot_20210107_173046.webp
    Screenshot_20210107_173046.webp
    16 KB · Views: 34
  • Screenshot_20210109_162410_com.radinc.csharpshell.webp
    Screenshot_20210109_162410_com.radinc.csharpshell.webp
    65.7 KB · Views: 28
manghingi ka muna ng user input mo lods after mo i-display yung mga pagpipilian. after nun, gawan mo ng switch yung variable na yun gamit "int uInput = ReadLine();" tas lagyan mo ng mga conditions yung cases sa switch mo
 
manghingi ka muna ng user input mo lods after mo i-display yung mga pagpipilian. after nun, gawan mo ng switch yung variable na yun gamit "int uInput = ReadLine();" tas lagyan mo ng mga conditions yung cases sa switch mo
using System;
using System.IO;
using System.Linq;
using System.Collections.Generic;

namespace CSharp_Shell
{

public class Program
{
public static void Main()
{
Queue<string> queue = new Queue<string>();
int input = 0;

Console.WriteLine("=>Queue Menu<=");
Console.WriteLine("1.Add an element(Back)");
Console.WriteLine("2.Remove front element");
Console.WriteLine("3.Search an element");
Console.WriteLine("4.Display Queue Elements");
Console.WriteLine("5.Exit");
Console.WriteLine("Enter Your Choice: ");
input = Convert.ToInt32(Console.ReadKey());

//Queue<string> queue = new Queue<string>();
//Add an element
queue.Enqueue("Mama");
queue.Enqueue("Papa");
queue.Enqueue("ate");
queue.Enqueue("Kuya");
queue.Enqueue("Bunso");

//Console.WriteLine("ENTER YOUR CHOICE: ");
//Console.ReadLine();



//Console.WriteLine();
//Remove first element
//queue.Dequeue();

//search element
string search = "second";
var result = queue.FirstOrDefault(x => x.Contains(search));
Console.WriteLine(result );

//display queue
foreach(var q in queue){
Console.WriteLine(q);

int Queue = 0;
switch (Queue)
{
case 1:
Console.WriteLine("All the Elements"+ queue.Count);
break;
case 2:
queue.Dequeue();
Console.WriteLine("Remove front Elemennt");
break;
case 3:
Console.WriteLine("");
break;
case 4:
Console.WriteLine("");
break;
case 5:
Console.WriteLine("");
break;

}




}

}
}
}
 
Ayan po yung code ko. Makalat papo. Nilalagay kolang po yung satingin ko kaylangan ko bago ko ayusin kaya kang nakakalito.
 
after nung line 18, maglagay ka pa ng isang Write line na nagsasabing "Enter your input" tas after nyan, lagay ka na nag Read line
 
wala akong c# IDE lods diko mararun yan. nag babase lang ako jan sa code mo tas w3school haha. diko pa kasi nasubukan mag c# pero same lang naman sila structure ng java
 
Status
Not open for further replies.

About this Thread

  • 81
    Replies
  • 3K
    Views
  • 15
    Participants
Last reply from:
Maginaku

Trending Topics

Online now

Members online
1,025
Guests online
1,508
Total visitors
2,533

Forum statistics

Threads
2,272,371
Posts
28,942,258
Members
1,237,160
Latest member
yamotzkie
Back
Top