Search results

  1. Codemastr

    News AMD Ryzen 3000 Series - Release date, price, specs

    Today at Computex 2019, AMD officially announced Ryzen 3000 series. Lisa Su, CEO of AMD, held the event announcing the new set of processors based on the Zen 2 chiplet. Lisa Su said that the new generation is compatible with the AM4 platform and that there is a 15% IPC improvement over the...
  2. Codemastr

    News Google stored G-Suite users passwords in plaintext

    On May 20th, Google admited to store some of their G-Suite users passwords in plaintext since 2005. Even though they didn't explicitly said how many accounts were stored in that way, it's well known that G-Suite has more than 5 million enterprise costumers. Google also stated that all passwords...
  3. Codemastr

    Solved Exercise Input 3 integers and check whether the sum of the first two are greater than the third one in Java

    Write a Java program which accepts three integers and check whether sum of the first two given integers is greater than third one. This is the code that solves this requirement: import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new...
  4. Codemastr

    Solved Exercise Place n Bishops in a chessboard and find the positions where a Queen wouldn't be eated by any of the bishops in C++

    Place n Bishops in a chessboard and find the positions where a Queen wouldn't be eated by any of the bishops in C++. Represent the bishops as "1" and the Queens by "8" in a 8x8 integer matrix and print it at the end showing the solutions. /* Author: Codemastr Date: 13/05/2016 */ #include...
  5. Codemastr

    Solved Exercise Write a program that lists all files in a directory with depth n in Java

    Write a program that lists all files in a directory in Java. Depth should be a variable for the constructor of the class Directory. For example: Directory(1) would show files in the current directory. Directory(2) would show files in the current directory and the names of the files inside the...
  6. Codemastr

    Solved Exercise Hashing Class in Java

    Create a Java class that takes a message as input and hash it with SHA-256. This is the code that solves this requirement: import java.nio.charset.StandardCharsets; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.Base64; import...
  7. Codemastr

    Solved Exercise BeanMachine in Java

    Write a Java Program that emulates a BeanMachine. It should describe the path of each ball by printing "L" if it went left and "R" if it went right. Then, print the balls in each slot. Follow image 7.13 taken from Java: How to Program by Deitel & Deitel as reference of a Bean Machine. This is...
  8. Codemastr

    Solved Exercise Caesars Cipher Function in C#

    Write a Caesars Cipher function in C# This is the code that solves this requirement: /* * Author: Codemastr * Date: 2019-17-02 */ using System; using System.Text; // Needed for StringBuilder() namespace CesarCipher { class Program { static void Main(string[] args)...
  9. Codemastr

    Solved Exercise Calculate water usage in C#

    Suppose that the average shower expels 6 liters/min and a regular water bottle handles 500ml. Calculate the equivalent of water bottles for a shower if the user is prompted to input the number of minutes that the shower lasted. At the end, a message should be printed saying: “Today, your shower...
  10. Codemastr

    Solved Exercise Write a Program in C++ that verifies the numbers present in two arrays and returns the list of numbers present in both and in neither array.

    Write a Program in C++ that has two integer arrays of size 20. Fill the arrays with random numbers from 1 to 40. Then, verify which numbers are present in both arrays and which in neither of them. Print the results. This is the code that solves this requirement: /* Author: Codemastr Date...
  11. Codemastr

    Solved Exercise Exercise 6.42 Distance between points - C++ How To Program Deitel & Deitel (9th Edition)

    Write function distance that calculates the distance between two points (x1, y1, z1) and (x2, y2, z2) in 3 dimensions. All numbers and return values should be of type double. [Hint: Distance = SquareRoot(x1x2+y1y2+z1*z2)] This is the code that solves this requirement: /* Author: Codemastr...
  12. Codemastr

    No, there is a follower list. You can interact with anyone that is registered.

    No, there is a follower list. You can interact with anyone that is registered.
  13. Codemastr

    Solved Exercise C++ Function to count number of digits, get the i digit and graficate a giant digit.

    Write a C++ program that solves the following: a. Create a function that receives as input a number, and that returns an integer representing the number of digits of the integer. For example: The integer 40567 has 5 digits, the integer 918720 has 6 digits and the integer 34 has 2 digits. b...
  14. Codemastr

    Solved Exercise Write the sin & cos function in C++ (without built-in libraries)

    Write two functions, sin and cos. Both will take, as input, a decimal number that represents an angle in radians. Use it to calculate the sin and cos. Don't use the built-in C++ libraries. This is the code that solves this requirement: /* Author: Codemastr Date: 2019-2-6 */ #include...
  15. Codemastr

    Solved Exercise Function for base change in C++

    Write a C++ function that receives as parameters an integer number and the base you wish to convert it to. Follow the example: change_base(7,3) output: 21 change_base(89,5) output: 324 This is the code that solves this problem: #include <iostream> using namespace std; int change_base(int...
  16. Codemastr

    Hey! Welcome, thank you for joining

    Hey! Welcome, thank you for joining
  17. Codemastr

    Solved Exercise Write a C++ function that adds the digits of a number

    Write a C++ function called addition_digits that receives as parameter a number and returns the addition of its digits. Convert negative numbers into positives. Follow the examples: addition_digits(78) output: 15 addition_digits(-5023) output: 10 This is the code that solves this requirement...
  18. Codemastr

    Solved Exercise Function for Temperature Conversion in C++

    Write a C++ function called convert_temperature. It must receive two parameters: the quantity and the unit you want to convert to represented by "C" for Celsius and "F" for Fahrenheit. If the unit doesn't exist, return the same input quantity. This is the code that solves this requirement: /*...
  19. Codemastr

    Tutorial Install an IDE with C++ Compiler in Windows (Codeblocks 17.12)

    Step 1: Download the installer file containing the C++ compiler. Latest Version 17.02: Codeblocks 17.02 Step 2: Run the downloaded installer. Accept the default options. Step 3: Test that Codeblocks is working correctly by creating a Hello World file. Go to: File -> New...
  20. Codemastr

    Solved Exercise Function to round a number in C++

    Write a C++ function called round. This function will round the number. The function receives as parameters a decimal number and the quantity of decimals required. Test the function with this examples: round(4.176853, 2) Output: 4.18 round(4.176853, 4) Output: 4.1769 This is the code that...