Skip to content

TaniaUba/Test

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Test

Problem 1

Given a time in 12-hour AM/PM format, convert it to military (24-hour) time. Note: - 12:00:00AM on a 12-hour clock is 00:00:00 on a 24-hour clock. 12:00:00PM on a 12-hour clock is 12:00:00 on a 24-hour clock.

Example Input

A single string that represents a time in 12-hour clock format (i.e.: hh:mm:ss:AM or hh:mm:ss:PM).

'12:01:00:AM'

Example Output

'00:01:00'

Extra

Create a specific function for the conversion

Problem 2

Given an array of integers, find the sum of its elements, max and min values.

For example, if the array ar=[1,2,3], 1+2+3=6 so return 6 3 1.

Example Input

[10,2,3,4,8,2]

Example Output

29 10 2

Extra

Use arrow functions

Problem 3

Staircase detail This is a staircase of size n=4:

   .
  ..
 ...
....

Its base and height are both equal to n. It is drawn using . symbols and spaces. The last line is not preceded by any spaces. Write a program that prints a staircase of size n.

Example Input

6

Example Output

     .
    ..
   ...
  ....
 .....
......

Extra

Print the staircase upside down

Extra Problem

Using classes create a rectangle object, which will return the area once it is instantiated

Example Input

new rectangle(2,3)

Example Output

6

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 94.7%
  • HTML 5.3%