jeudi 8 septembre 2022

C# Random Floating Point Numbers

Write a program that displays an array of random floating point numbers of size 5 rows and 6 columns.

Each number has to be randomly generated. Each number has to have exactly two digits to the right of decimal point (e.g. 13.14). The numbers generated are between 5 and 19. If the number is odd, the background color should be Blue. If the number is even, the background color should be Red. If the fraction part of the generated number is less than .6 then that number should be skipped (i.e. not displayed). Another number should be generated to replace it. Use the "continue" key word is C# to achieve this. You are not allowed to use the syntax of arrays in C# for this HAW. The display should be format in an array style 5 different lines on the console, each line will have 6 numbers of each row. Make sure to format the spacing correctly. Take care of uneven rows




Aucun commentaire:

Enregistrer un commentaire