Category: cpp

Day 4: Class vs. Instance

             Day 4: Class vs. Instance Objective In this challenge, we're going to learn about the difference between a class and an instance; because this is an Object Oriented concept, it's only enabled in certain languages. Check out the Tutorial tab for learning materials and an instructional video! Task Write a Person class with an instance variable, , and a

First Repeating Character From Last

                            First Repeating Character   A string S is passed as the input. S has at least one repeating character. The program must print the first repeating character C from the last. Input Format: The first line contains S. Output Format: The

Matrix Row Sum

                            Matrix Row Sum   Given a R*C matrix (R - rows and C- Columns), print the sum of the values in each row as the output. Input Format: First line will contain R and C separated by a space. Next R

Minimum Distance Between Alphabets

                Minimum Distance Between Alphabets      Minimum Distance Between Alphabets :Given a string S and two alphabets C1 and C2 present in S, find the minimum distance D  between C1 and C2 in S. Input Format: The first line will contain S. The second line will contain

Head Count – Birds and Animals

                 Head Count - Birds and Animals     In a zoo there are some birds and animals. All birds have two legs and all animals have four legs. GIven the head count and leg count of both birds and animals taken together, the program must print the

Day 2: Operators

                 Day 2: Operators Objective In this challenge, you'll work with arithmetic operators. Check out the Tutorial tab for learning materials and an instructional video! Task Given the meal price (base cost of a meal), tip percent (the percentage of the meal price being added as tip),) and tax percent (the percentage of the meal price being added as tax)

Day 3: Intro to Conditional Statements

Day 3: Intro to Conditional Statements   Objective In this challenge, we're getting started with conditional statements. Check out the Tutorial tab for learning materials and an instructional video! Task Given an integer, , perform the following conditional actions: If  is odd, print Weird If  is even and in the inclusive range of  to , print Not Weird If  is even and in the inclusive

Four Strings Square

                        Four Strings Square   Four strings all having the same length L are passed as the input to the program. The four strings must be printed in a L*L square matrix shape as shown in the example input/output. The string which is on

Smallest Substring – All Distinct Letters

         Smallest Substring - All Distinct Letters                           A string value S containing only alphabets (both lower and upper case) is passed as input to the program. The program must print the size of the smallest substring which contains all

Morning Walk Distance

                        Morning Walk Distance   A man in order to reduce his weight walks along the boundary of a rectangular plot every morning. Depending on his energy level he walks for N rounds on a given day. Given the length L and breadth B