8 kyu

Playing with cubes II

1,446 of 8,851Jotha

Description:

Hey Codewarrior!

In the previous kata, you have implemented a Cube class, but now we need your help again! I'm talking about constructors. We don't have one. Let's code one (or more) such that one can instantiate an object via it, handling either no arguments or a single integer.

Also we got a problem with negative values. Correct the code so negative values will be switched to positive ones!

The constructor taking no arguments should assign 0 to Cube's Side property.

Fundamentals
Object-oriented Programming

Stats:

CreatedAug 4, 2015
PublishedAug 4, 2015
Warriors Trained15652
Total Skips596
Total Code Submissions40087
Total Times Completed8851
C# Completions1446
Python Completions3736
Ruby Completions373
JavaScript Completions2954
TypeScript Completions445
Java Completions246
Total Stars132
% of votes with a positive feedback rating82% of 1223
Total "Very Satisfied" Votes885
Total "Somewhat Satisfied" Votes238
Total "Not Satisfied" Votes100
Ad
Contributors
  • Jotha Avatar
  • g964 Avatar
  • GiacomoSorbi Avatar
  • pioraid Avatar
  • akim-mcmath Avatar
  • Blind4Basics Avatar
  • Madjosz Avatar
  • rowcased Avatar
  • hobovsky Avatar
  • ekkof Avatar
  • Just4FunCoder Avatar
  • KayleighWasTaken Avatar
Ad