Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace arvioitavaTehtava2
- {
- class Program
- {
- static void Main(string[] args)
- {
- bool tahtirivi = true;
- TulostaOtsikko(tahtirivi);
- Console.WriteLine("Anna lämpötila celsiusasteina: ");
- int celsius = int.Parse(Console.ReadLine());
- Console.WriteLine("Lämpötila on fahrenheiteina " + MuunnaLampotila(celsius));
- // MuunnaLampotila2(celsius); VAIHTOEHTOINEN, EI KÄYTÖSSÄ
- Console.ReadKey();
- }
- public static void TulostaOtsikko(bool tahtirivi)
- {
- Console.WriteLine("Celsius Fahrenheiteiksi");
- if (tahtirivi)
- {
- Console.WriteLine("***********************");
- }
- }
- public static int MuunnaLampotila(int celsius)
- {
- int fahrenheit = (celsius * 9) / 5 + 32;
- return fahrenheit;
- }
- //public static void MuunnaLampotila2(int celsius)
- //{
- // int fahrenheit = (celsius * 9) / 5 + 32;
- // Console.WriteLine("Lämpötila on fahrenheiteina " + fahrenheit);
- //}
- // VAIHTOEHTOINEN, EI KÄYTÖSSÄ
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment