У нас вы можете посмотреть бесплатно C# Methods | Value Returning and Non Value Returning | Parameters | Optional Parameter | C# Tutorial или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса ClipSaver.ru
Here is one example that covers all of the concepts below: 1. C# Methods - non value returning 2. C# Methods - value returning 3. C# Methods - no parameters, one parameter, multiple parameters and optional parameter 4. C# Method call within a method call (Process called Nesting methods) 5. Code reduction {Coding less instructions to achieve the same results} 6. Converting returning values from one data type to another. Like, Share, And Subscribe | Professor Saad Yousuf Watch Our All Videos On This : / professorsaad Subscribe Our Channel : / professorsaad Playlists: / ssby79 C# Methods | Value Returning and Non Value Returning | Parameters | Optional Parameter | C# Tutorial #Methods #ValueReturning #NonValueReturning #OptionalParameters CODE: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ModularizationExampleX1 { using static System.Console; class Program { static void Main(string[] args) { //calling method BookInfo() //You can call a method from the call to another method //BookInfo(val1, val2); //BookInfo(input(), val2); BookInfo(input(), Convert.ToDouble(input("Please enter a book price: "))); //sequence of parameters must match //accepting input from user then passing that as parameters to method BookInfo() //call Method input() it will return a value of type string, then store that value in the variable string title = input(); double pr = Convert.ToDouble(input("Please enter a book price: ")); BookInfo(title, pr); Read(); } static void BookInfo(string title, double price) { WriteLine("Book Title: " + title); WriteLine("Book Price: " + price.ToString("C")); } //accept the input from user and send the input back to Main() //to code a value returning method /* DATATYPE is the return type and return statement will return a value of that type static DATATYPE MethodName({optional parameters}) { return valueDATATYPE; } */ //optional parameter - Chapter 8 Pages 332 through 334 static string input(string msg= "Please Enter a Book Title: ") { Write(msg); string title = ReadLine(); return title; } } }