7 kyu

Dot Calculator

3,096 of 6,600ryanthestupid

Description:

Dot Calculator

You have to write a calculator that receives strings for input. The dots will represent the number in the equation. There will be dots on one side, an operator, and dots again after the operator. The dots and the operator will be separated by one space.

Here are the following valid operators :

  • + Addition
  • - Subtraction
  • * Multiplication
  • // Integer Division

Your Work (Task)

You'll have to return a string that contains dots, as many the equation returns. If the result is 0, return the empty string. When it comes to subtraction, the first number will always be greater than or equal to the second number.

Examples (Input => Output)

* "..... + ..............." => "...................."
* "..... - ..."             => ".."
* "..... - ."               => "...."
* "..... * ..."             => "..............."
* "..... * .."              => ".........."
* "..... // .."             => ".."
* "..... // ."              => "....."
* ". // .."                 => ""
* ".. - .."                 => ""
Strings
Fundamentals

Stats:

CreatedApr 10, 2021
PublishedApr 12, 2021
Warriors Trained11091
Total Skips202
Total Code Submissions16616
Total Times Completed6600
Python Completions3096
JavaScript Completions2580
C Completions126
COBOL Completions9
Julia Completions12
Lua Completions57
Ruby Completions118
Java Completions580
NASM Completions6
C# Completions170
Haskell Completions5
Total Stars134
% of votes with a positive feedback rating91% of 841
Total "Very Satisfied" Votes722
Total "Somewhat Satisfied" Votes91
Total "Not Satisfied" Votes28
Total Rank Assessments110
Average Assessed Rank
7 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • ryanthestupid Avatar
  • Chrono79 Avatar
  • hobovsky Avatar
  • stellartux Avatar
  • trashy_incel Avatar
  • akar-0 Avatar
  • tobeannouncd Avatar
  • Insisted Avatar
  • Stami Avatar
Ad