Skip to content

UMK-Data-Science/week-2-tutorial-array

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tutorial 2 - Array

This tutorial cover 1D-array and 2D-array, please answer all questions :octocat:

Instructions

This tutorial consists with 5 questions:

  • Exercise 1
  • Exercise 2
  • Exercise 3
  • Exercise 4
  • Exercise 5

Try to complete this tutorial by commit your changes and read the question carefully ⭐

Exercise 1

Declare an array (1D) name currencyWorld of type float that can store up to 5 floating-point number. Initialize the value for currencyWorld with 4.50, 5.55, 3.65, 1.20, 6.56. Next, print the third element from the array.

Exercise 2

Declare an array (1D) name myName of type char that can store your full name in the array and print the output as follow:

  • My Name is _____, Bachelor of Information Technology from Universiti Malaysia Kelantan

Exercise 3

Declare an array (2D) name myAlphabet of type char that can store listed value from the table below. Next, print the value from row 3 column 3 as follow:

  • Character from Row 3 and Column 3 is _____
Char 1 Char 2 Char 3
h g f
c n p
o m q

Exercise 4

Declare an array (2D) name theValue of type int that can store listed value from the table below. Next, print the value from row 2 column 3 as follow:

  • Value from Row 2 and Column 3 is _____
Value 1 Value 2 Value 3
10 100 20
50 20 40
40 40 10

Exercise 5

Write a program to find the average of 5 numbers insert by the user using arrays and print the average value as follow:

  • Average value is _____

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages