repl.it
@kironroy/

imagesize

C#

No description

fork
loading
Files
  • main.cs
  • main.exe
  • notes.txt
main.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using System;

class MainClass {
 public static void Main(string[] args) {
  imagePortOrLandscape();
 } // Main Method


 private static void imagePortOrLandscape() {
  Console.WriteLine("Please enter width of image");

  string imageComment = "The images is in ";

  string width = Console.ReadLine().Trim();


  double widthConvert = Convert.ToDouble(width);

  BreakLine();

  Console.WriteLine("Please enter height of image");

  string height = Console.ReadLine().Trim();
  double heightConvert = Convert.ToDouble(height);

  if (widthConvert > heightConvert) {
   Console.WriteLine(imageComment + "landscape");
  } else if (heightConvert > widthConvert) {
   Console.WriteLine(imageComment + "portrait");
  } else {
   Console.WriteLine(imageComment + "square format");

  }
  Console.WriteLine();
 }

 // breakline method
 private static void BreakLine() {
  Console.WriteLine();
 }


} // MainClass