Sign up
Login
New paste
Home
English
English
Português
Sign up
Login
New Paste
Browse
using System; namespace Homework_4 { class Program { static void Main(string[] args) { void ex1() { Console.WriteLine("enter a grade"); int grade = int.Parse(Console.ReadLine()); if (grade >= 0 && grade <= 100) { Console.WriteLine("the grade is valid"); } else { Console.WriteLine("the grade is invalid"); } } void ex2() { Console.WriteLine("enter a grade"); int grade = int.Parse(Console.ReadLine()); Console.WriteLine("enter class avg"); double avg = int.Parse(Console.ReadLine()); double gradeB = grade + (avg/100 * 10); if (gradeB > 100) { gradeB = 100; } Console.WriteLine("The grade after the bonus is: "+gradeB); } void ex3() { Console.WriteLine("enter a digit"); int num = int.Parse(Console.ReadLine()); Console.WriteLine("enter another digit"); int num2 = int.Parse(Console.ReadLine()); if ( (num%2 == 0) && (num2%2 == 1) || (num%2 == 1) && (num2%2 == 0)) { Console.WriteLine("the digits are "+num+" "+num2+" and the sum is: " + (num+num2)); } else { Console.WriteLine("both numbers are zogi or unzogi"); } } void ex4() { Console.WriteLine("enter a 4 numbered number"); // 5115 int num = int.Parse(Console.ReadLine()); int num1 = num%10; int num2 = num/10%10; int num3 = num/100%10; int num4 = num/1000; if (num1 == num4 && num2 == num3) { Console.WriteLine("the num is a palindrom"); } else { Console.WriteLine("the num is *NOT* a palindrom"); } } void ex5() { Console.WriteLine("enter a number"); int num = int.Parse(Console.ReadLine()); if (num/10 == 0) { Console.WriteLine("num is singular"); } else { Console.WriteLine("num is plural"); } } void ex6() { Console.WriteLine("enter num1"); int num1 = int.Parse(Console.ReadLine()); Console.WriteLine("enter num2"); int num2 = int.Parse(Console.ReadLine()); Console.WriteLine("enter num3"); int num3 = int.Parse(Console.ReadLine()); if ((num1 - num2) == (num2-num3)) { Console.WriteLine("the numbers are making a math street."); } else { Console.WriteLine("the numbers are *not* making a math street"); } } void ex7() { Console.WriteLine("enter a char"); char ch = char.Parse(Console.ReadLine()); if ((int)ch >= (int)'a' && (int)ch <= (int)'z') { Console.WriteLine(ch + " is in the lowercase abc"); } else { Console.WriteLine(ch + " is not in the lowercase abc"); } } void ex8() { Console.WriteLine("enter num1"); int num1 = int.Parse(Console.ReadLine()); Console.WriteLine("enter num2"); int num2 = int.Parse(Console.ReadLine()); Console.WriteLine("enter num3"); int num3 = int.Parse(Console.ReadLine()); if ((num1*num1) + (num2*num2) == (num3*num3) || (num1*num1) + (num3*num3) == (num2*num2) || (num2*num2) + (num3*num3) == (num1*num1) ) { Console.WriteLine("numbers make a pitogorit trio"); } else { Console.WriteLine("numbers do not make a potogorit trio"); } } void ex10() { Console.WriteLine("enter a 2 numbered num"); int num = int.Parse(Console.ReadLine()); int num1,num2; num1 = num%10; num2 = num/10%10; Console.WriteLine(num + " before"); if (num%2 == 0) { num = num1+1 + (num2+1)*10; } else { num = num1-1 + (num2-1)*10; } Console.WriteLine(num + " after"); } } } }
Paste Settings
Paste Title :
[Optional]
Paste Folder :
[Optional]
Select
Select
Syntax Highlighting :
[Optional]
Select
Markup
CSS
JavaScript
Bash
C
C#
C++
Java
JSON
Lua
Plaintext
C-like
ABAP
ActionScript
Ada
Apache Configuration
APL
AppleScript
Arduino
ARFF
AsciiDoc
6502 Assembly
ASP.NET (C#)
AutoHotKey
AutoIt
Basic
Batch
Bison
Brainfuck
Bro
CoffeeScript
Clojure
Crystal
Content-Security-Policy
CSS Extras
D
Dart
Diff
Django/Jinja2
Docker
Eiffel
Elixir
Elm
ERB
Erlang
F#
Flow
Fortran
GEDCOM
Gherkin
Git
GLSL
GameMaker Language
Go
GraphQL
Groovy
Haml
Handlebars
Haskell
Haxe
HTTP
HTTP Public-Key-Pins
HTTP Strict-Transport-Security
IchigoJam
Icon
Inform 7
INI
IO
J
Jolie
Julia
Keyman
Kotlin
LaTeX
Less
Liquid
Lisp
LiveScript
LOLCODE
Makefile
Markdown
Markup templating
MATLAB
MEL
Mizar
Monkey
N4JS
NASM
nginx
Nim
Nix
NSIS
Objective-C
OCaml
OpenCL
Oz
PARI/GP
Parser
Pascal
Perl
PHP
PHP Extras
PL/SQL
PowerShell
Processing
Prolog
.properties
Protocol Buffers
Pug
Puppet
Pure
Python
Q (kdb+ database)
Qore
R
React JSX
React TSX
Ren'py
Reason
reST (reStructuredText)
Rip
Roboconf
Ruby
Rust
SAS
Sass (Sass)
Sass (Scss)
Scala
Scheme
Smalltalk
Smarty
SQL
Soy (Closure Template)
Stylus
Swift
TAP
Tcl
Textile
Template Toolkit 2
Twig
TypeScript
VB.Net
Velocity
Verilog
VHDL
vim
Visual Basic
WebAssembly
Wiki markup
Xeora
Xojo (REALbasic)
XQuery
YAML
HTML
C#
Paste Expiration :
[Optional]
Never
Self Destroy
10 Minutes
1 Hour
1 Day
1 Week
2 Weeks
1 Month
6 Months
1 Year
Paste Status :
[Optional]
Public
Unlisted
Private (members only)
Password :
[Optional]
Description:
[Optional]
Tags:
[Optional]
Encrypt Paste
(
?
)
Create New Paste
You are currently not logged in, this means you can not edit or delete anything you paste.
Sign Up
or
Login
Site Languages
×
English
Português
Do you like cookies?
🍪 We use cookies to ensure you get the best experience on our website.
Learn more
I agree