CJCoding With Joseph
15free / daySign inCreate account
TitleTopicsAction
29
Declare an IntDeclare an `int` variable named `count` with the value 10, then print it (see Ex...
easy○ Not Started
Variables
Solve
30
Declare a DoubleDeclare a `double` variable named `pi` with the value 3.14, then print it (see E...
easy○ Not Started
Variables
Solve
31
Declare a StringDeclare a `string` variable named `word` with the value "hello", then print it (...
easy○ Not Started
Variables
Solve
32
Declare a BoolDeclare a `bool` variable named `isReady` with the value true, then print it (C#...
easy○ Not Started
Variables
Solve
33
Sum of Two Int VariablesTwo int variables `a` and `b` are given. Print their sum (see Expected Output)....
easy○ Not Started
Variables
Solve
34
Difference of Two VariablesTwo int variables are given. Print the first minus the second (see Expected Outp...
easy○ Not Started
Variables
Solve
35
Product of Two VariablesTwo int variables are given. Print their product (see Expected Output)....
easy○ Not Started
Variables
Solve
36
Use var for Type InferenceThe `var` keyword lets C# infer the type from the value. Use `var` to declare a ...
easy○ Not Started
Variables
Solve
37
Declare a ConstantA `const` value cannot be changed after it is set. Declare `const int Max = 100;...
easy○ Not Started
Variables
Solve
38
Integer DivisionWhen both operands are ints, `/` does integer division (it drops the fractional ...
easy○ Not Started
Variables
Solve
39
Remainder with ModuloThe `%` operator gives the remainder of a division. Print the remainder of 17 di...
easy○ Not Started
Variables
Solve
40
Double DivisionIf at least one operand is a double, `/` keeps the decimal part. Print the resul...
easy○ Not Started
Variables
Solve
41
Reassign a VariableDeclare an int with value 5, then reassign it to 10, then print it (see Expected...
easy○ Not Started
Variables
Solve
42
Increment a VariableThe `++` operator adds 1 to a variable. Start with 5, increment it, then print i...
easy○ Not Started
Variables
Solve
43
Compound AssignmentThe `+=` operator adds a value to a variable. Start with 10, add 5 using `+=`, t...
easy○ Not Started
Variables
Solve
44
Average of Two NumbersTwo int variables are given. Print their (integer) average (see Expected Output)...
easy○ Not Started
Variables
Solve
237
Your First IntegerEvery program keeps track of data using variables. In this exercise you will cre...
easy○ Not Started
Variables
Solve
238
Greeting with a StringString variables hold text. Declare a string variable named name and assign it t...
easy○ Not Started
Variables
Solve
239
A Price with DecimalsThe double type stores numbers that can have a decimal point. Declare a double v...
easy○ Not Started
Variables
Solve
240
True or FalseA bool variable holds one of two values: true or false. Declare a bool variable ...
easy○ Not Started
Variables
Solve
241
A Single CharacterThe char type stores exactly one character, written between single quotes. Decla...
easy○ Not Started
Variables
Solve
242
Adding Two NumbersVariables can be combined in calculations. Declare two int variables: a with the...
easy○ Not Started
Variables
Solve
243
Changing a ValueAfter you declare a variable you can change its value by assigning a new one, as...
easy○ Not Started
Variables
Solve
342
Declare a CharDeclare a `char` variable named `letter` with the value `'A'`, then print it (se...
easy○ Not Started
Variables
Solve
343
Declare a LongDeclare a `long` variable named `population` with the value `8000000000` (too la...
easy○ Not Started
Variables
Solve
344
Declare a FloatDeclare a `float` variable named `pi` with the value `3.14f`, then print it (see...
easy○ Not Started
Variables
Solve
345
Declare a DecimalDeclare a `decimal` variable named `price` with the value `19.99m`, then print i...
easy○ Not Started
Variables
Solve
346
Declare a ByteDeclare a `byte` variable named `level` with the value `255` (the largest value ...
easy○ Not Started
Variables
Solve
347
Negate a BooleanA `bool isOpen` is set to `true`. Declare `bool isClosed` as its logical opposit...
easy○ Not Started
Variables
Solve
348
ASCII Code to CharacterThe integer `code = 66` is an ASCII value. Cast it to a `char` and print the cha...
easy○ Not Started
Variables
Solve
349
Convert an Int to a StringDeclare `int year = 2026`. Convert it to a `string` using `.ToString()`, store t...
easy○ Not Started
Variables
Solve
350
Decrement a VariableDeclare `int lives = 3`, then use the `--` operator to decrease it by one and pr...
easy○ Not Started
Variables
Solve
351
Square a VariableDeclare `int n = 6`. Compute its square (`n` times `n`), store it in `square`, t...
easy○ Not Started
Variables
Solve
352
Negate a NumberDeclare `int n = 5`. Store its negation (`-n`) in a variable named `opposite`, t...
easy○ Not Started
Variables
Solve
353
Area of a RectangleDeclare `int width = 5` and `int height = 3`. Compute the area (`width` times `h...
easy○ Not Started
Variables
Solve
45
Cast a Double to an IntCasting a double to an int with `(int)` drops the decimal part (it truncates, no...
medium○ Not Started
Variables
Solve
46
Parse a String to an Int`int.Parse` converts a string of digits into an int. Parse "42" and print the va...
medium○ Not Started
Variables
Solve
47
Divide Ints as DoublesTo get a decimal result from two ints, cast one to double first. Print 7 divided...
medium○ Not Started
Variables
Solve
48
Store a Boolean ExpressionA comparison can be stored in a bool variable. Given x = 10, store whether x is ...
medium○ Not Started
Variables
Solve
49
Swap Two VariablesSwap the values of two int variables using a temporary variable, then print them...
medium○ Not Started
Variables
Solve
50
Parse a String to a Double`double.Parse` converts a decimal string to a double. Parse "3.5", add 1, and pr...
medium○ Not Started
Variables
Solve
51
Character to ASCII CodeCasting a `char` to an `int` gives its character code. Print the code for the le...
medium○ Not Started
Variables
Solve
52
Declare Several VariablesYou can declare several variables of the same type in one statement. Declare thr...
medium○ Not Started
Variables
Solve
53
Celsius to FahrenheitConvert a Celsius temperature to Fahrenheit using F = C * 9 / 5 + 32. Given cels...
medium○ Not Started
Variables
Solve
244
A Small ProfileReal programs often combine several different variable types in one message. Dec...
medium○ Not Started
Variables
Solve
245
Comparing for EqualityA boolean variable can store the result of a comparison. Declare two int variabl...
medium○ Not Started
Variables
Solve
246
Building a Word from CharactersConsole.Write prints without moving to a new line, while Console.WriteLine adds ...
medium○ Not Started
Variables
Solve
354
Fahrenheit to CelsiusDeclare `double fahrenheit = 212`. Convert it to Celsius with the formula `(fahr...
medium○ Not Started
Variables
Solve
355
Last Digit of a NumberDeclare `int number = 3742`. Use the modulo operator `%` to find its last digit,...
medium○ Not Started
Variables
Solve
356
Assign the Max with a TernaryDeclare `int a = 7` and `int b = 3`. Use the ternary operator `?:` to store the ...
medium○ Not Started
Variables
Solve
357
Compute a PercentageDeclare `int score = 45` and `int total = 60`. Compute what percentage `score` i...
medium○ Not Started
Variables
Solve
358
Combine Conditions with ANDDeclare `int age = 25` and `bool hasTicket = true`. Store whether the person can...
medium○ Not Started
Variables
Solve
359
Combine Conditions with ORDeclare `bool isWeekend = false` and `bool isHoliday = true`. Store whether it i...
medium○ Not Started
Variables
Solve
360
Digit Character to NumberDeclare `char digit = '7'`. Convert the character to its numeric value by subtra...
medium○ Not Started
Variables
Solve
361
Minutes to Hours and MinutesDeclare `int totalMinutes = 135`. Split it into whole hours and leftover minutes...
medium○ Not Started
Variables
Solve
362
Apply a DiscountDeclare `int price = 80` and `int discountPercent = 25`. Compute the final price...
medium○ Not Started
Variables
Solve
363
Seconds to H:M:SDeclare `int totalSeconds = 5025`. Break it into hours, minutes, and seconds, th...
hard○ Not Started
Variables
Solve
364
Reverse a Three-Digit NumberDeclare `int n = 123`. Using arithmetic on its digits (no loops or strings), bui...
hard○ Not Started
Variables
Solve
365
Sum of Digits of a Three-Digit NumberDeclare `int n = 384`. Using arithmetic (no loops or strings), add its three dig...
hard○ Not Started
Variables
Solve
366
Split Cents into Dollars and CentsDeclare `int totalCents = 1234`. Split it into whole dollars and leftover cents,...
hard○ Not Started
Variables
Solve