Graderpractice for programmers

273387 Kotlin - Language basics Learning about variables, input/output, loops

Awaiting submission
Print "Hello Mor Nor" (without quotes).
Awaiting submission
Read in a name and then print out a greeting.
Awaiting submission
Read in a name (same as problem 2), and then print out "Hello " 10 times. Hint: use a loop!
Awaiting submission

Read in a name (same as problem 2) and a number X (integer). Print out "Hello " X times.

Note: if the 2nd input is not a number then do not print.

Awaiting submission
Read in a list of names, and for each one, print "Hello ". The input ends when the name "exit" is read.
Awaiting submission
You are making gift wrapping paper for Christmas! Write a program that reads the size of the paper (width and height), then print it out using the following pattern.
  • The pattern is @}~
  • Put 2 spaces between the pattern on the same line
  • The following line should be offset by 2 spaces
If the width of the paper is 7 then the line will be @}~ @}
You must print trailing spaces up to the end of the line.
Awaiting submission
A tautogram is a sentence or piece of text where all the words begin with the same letter. Write a program to determine if the input is a tautogram. The program can accept many lines of input. Output Y or N for each line.
Awaiting submission
A magic square is a n×n square grid filled with distinct positive integers in the range 1, 2, ... n2 such that each cell contains a different integer and the sum of the integers in each row, column and diagonal is equal.
4 9 2
3 5 7
8 1 6
Write a program that inputs a square and then checks that it is a magic square. The first line of input is the number of rows/columns n. The rest of the input is the square of integers. If it is a magic square then output "magic = X" where X is the sum of a row/column. Else output "invalid".