Описание
Сценарий:
Преподаватель объяснил своим ученикам концепцию различных типов переменных в C# и дал им задание для реализации. программа, демонстрирующая использование этих переменных. Программа должна включать объявления переменных, инициализацию и выполнение операций.
Помогите им выполнить задачу, используя свои навыки программирования на C#.
Functionalities:
In class Movie, implement the below-given static variable.
**Data Type | Variable Name**
**`string | name`**
In class Movie, implement the below-given Instance variables.
**Data Type | Variable Name**
**`int | ticketId`**
**`string | seatNumber`**
implement the below given method also,
Method
Description
**public Movie ReturnMovieDetails(string name, int ticketId, string seatNumber)**
This method is used to set movie details such as name, ticketId and seatNumber (Local Variables) to the movie object and return it.
In this method, create a movie object(Reference Variable) and assign the values, then return it.
In Program class - Main method,
1.Get the values from the user as per the Sample Input.
2.Call the above method and display the result as per the Sample Output.
Note:
Keep the variables, methods and classes as public.
Please read the method rules clearly.
Do not use Environment.Exit() to terminate the program.
Do not change the given code template.
Summary :
Through working on this task, they have learned about different types of variables in C#.
A static variable in C# is a class-level variable that is shared among all instances and retains its value throughout the program's execution.
An instance variable in C# is a non-static variable that belongs to a specific instance of a class and holds unique values for each instance.
A reference variable in C# is a variable that holds the memory address of an object rather than the actual object itself.
A local variable in C# is a variable that is declared and used within a specific block or method scope.
> Sample Input:
>
> Enter the movie name
>
> Avatar
>
> Enter the ticket id
>
> 101
>
> Enter the seat number
>
> A5
>
> Sample Output:
>
> Movie name : Avatar
>
> Ticket id : 101
>
> Seat number : A5
[For Program.Cs][1]
[For Main.Cs][2]
[For The Error I am Getiing][3]
[1]: https://i.sstatic.net/mLmjSqZD.png
[2]: https://i.sstatic.net/B9lNkizu.png
[3]: https://i.sstatic.net/trAq91jy.png
Подробнее здесь: https://stackoverflow.com/questions/790 ... -its-accen
Я новичок в C#, что я делаю неправильно, чтобы заслужить все эти ошибки. Это вопрос ACCENTURE PRIMER ⇐ C#
Место общения программистов C#
1728670467
Anonymous
Описание
Сценарий:
Преподаватель объяснил своим ученикам концепцию различных типов переменных в C# и дал им задание для реализации. программа, демонстрирующая использование этих переменных. Программа должна включать объявления переменных, инициализацию и выполнение операций.
Помогите им выполнить задачу, используя свои навыки программирования на C#.
Functionalities:
In class Movie, implement the below-given static variable.
**Data Type | Variable Name**
**`string | name`**
In class Movie, implement the below-given Instance variables.
**Data Type | Variable Name**
**`int | ticketId`**
**`string | seatNumber`**
implement the below given method also,
Method
Description
**public Movie ReturnMovieDetails(string name, int ticketId, string seatNumber)**
This method is used to set movie details such as name, ticketId and seatNumber (Local Variables) to the movie object and return it.
In this method, create a movie object(Reference Variable) and assign the values, then return it.
In Program class - Main method,
1.Get the values from the user as per the Sample Input.
2.Call the above method and display the result as per the Sample Output.
Note:
Keep the variables, methods and classes as public.
Please read the method rules clearly.
Do not use Environment.Exit() to terminate the program.
Do not change the given code template.
Summary :
Through working on this task, they have learned about different types of variables in C#.
A static variable in C# is a class-level variable that is shared among all instances and retains its value throughout the program's execution.
An instance variable in C# is a non-static variable that belongs to a specific instance of a class and holds unique values for each instance.
A reference variable in C# is a variable that holds the memory address of an object rather than the actual object itself.
A local variable in C# is a variable that is declared and used within a specific block or method scope.
> Sample Input:
>
> Enter the movie name
>
> Avatar
>
> Enter the ticket id
>
> 101
>
> Enter the seat number
>
> A5
>
> Sample Output:
>
> Movie name : Avatar
>
> Ticket id : 101
>
> Seat number : A5
[For Program.Cs][1]
[For Main.Cs][2]
[For The Error I am Getiing][3]
[1]: https://i.sstatic.net/mLmjSqZD.png
[2]: https://i.sstatic.net/B9lNkizu.png
[3]: https://i.sstatic.net/trAq91jy.png
Подробнее здесь: [url]https://stackoverflow.com/questions/79079343/i-am-new-to-c-sharp-what-am-i-doing-wrong-to-deserve-all-these-errors-its-accen[/url]
Ответить
1 сообщение
• Страница 1 из 1
Перейти
- Кемерово-IT
- ↳ Javascript
- ↳ C#
- ↳ JAVA
- ↳ Elasticsearch aggregation
- ↳ Python
- ↳ Php
- ↳ Android
- ↳ Html
- ↳ Jquery
- ↳ C++
- ↳ IOS
- ↳ CSS
- ↳ Excel
- ↳ Linux
- ↳ Apache
- ↳ MySql
- Детский мир
- Для души
- ↳ Музыкальные инструменты даром
- ↳ Печатная продукция даром
- Внешняя красота и здоровье
- ↳ Одежда и обувь для взрослых даром
- ↳ Товары для здоровья
- ↳ Физкультура и спорт
- Техника - даром!
- ↳ Автомобилистам
- ↳ Компьютерная техника
- ↳ Плиты: газовые и электрические
- ↳ Холодильники
- ↳ Стиральные машины
- ↳ Телевизоры
- ↳ Телефоны, смартфоны, плашеты
- ↳ Швейные машинки
- ↳ Прочая электроника и техника
- ↳ Фототехника
- Ремонт и интерьер
- ↳ Стройматериалы, инструмент
- ↳ Мебель и предметы интерьера даром
- ↳ Cантехника
- Другие темы
- ↳ Разное даром
- ↳ Давай меняться!
- ↳ Отдам\возьму за копеечку
- ↳ Работа и подработка в Кемерове
- ↳ Давай с тобой поговорим...
Мобильная версия