Skip to content

Instantly share code, notes, and snippets.

View DragonOsman's full-sized avatar

Osman Zakir DragonOsman

View GitHub Profile
1>E:\programming\visual_studio_2019\Projects\beginningcpp20\chapter5ex7\chapter5ex7\chapter5ex7.cpp(37,32): warning C4244: 'argument': conversion from 'double' to '_Ty', possible loss of data
1> with
1> [
1> _Ty=unsigned __int64
1> ]
1>E:\programming\visual_studio_2019\Projects\beginningcpp20\chapter5ex7\chapter5ex7\chapter5ex7.cpp(46,33): warning C4244: 'argument': conversion from 'double' to '_Ty', possible loss of data
1> with
1> [
1> _Ty=unsigned __int64
1> ]
// Osman Zakir
// Beginning C++20: From Novice to Professional by Ivor Horton and Peter Van Weert
// Chapter 5 Exercise 7
// Exercise Specs:
/**
* Write a program that will read and store an arbitrary sequence of records
* relating to products. each record includes three items of data—an integer product number,
* a quantity, and a unit price. For product number 1001, the quantity is 25 and the unit price is
* $9.95. Because you do not know yet how to create compound types, simply use three different
* array-like sequences to represent these records. The program should output each product
// Osman Zakir
// 11 / 11 / 2021
// Beginning C++20: From Novice to Professional by Ivor Horton and Peter Van Weert
// Chapter 4 Exercise 8
// Exercise Specs:
/**
* Create a program that prompts the user to enter an amount of money between
* $0 and $10 (decimal places allowed). Any other value is to be rejected politely.
* Determine how many quarters (25c), dimes (10c), nickels (5c), and pennies
* (1c) are needed to make up that amount. For our non-American readers,
// Osman Zakir
// 11 / 7 / 2021
// Beginning C++20: From Novice to Professional by Ivor Horton and Peter Van Weert
// Chapter 4 Exercise 2
// Exercise Specs:
/**
* Write another program that prompts for two integers to be entered. This time,
* any negative number or zero is to be rejected. Next, check whether one of the (strictly positive)
* numbers is an exact multiple of the other. For example, 63 is a multiple of 1, 3, 7, 9, 21, or 63.
* Note that the user should be allowed to enter the numbers in any order. That is, it does not
{
"author": "Osman Zakir"
}
@DragonOsman
DragonOsman / Circle.h
Created April 13, 2020 17:55
Solution for Beginning C++17, 5th Edition, Chapter 14 Exercise 6
#ifndef CIRCLE_H
#define CIRCLE_H
#include "Shape.h"
constexpr double pi{ 3.141592653589793238462643383279502884 };
class Circle : public Shape
{
protected:
@DragonOsman
DragonOsman / Animal.h
Last active April 11, 2020 23:56
Solution for Beginning C++17, 5th Edition, Chapter 14 Exercise 2
#ifndef ANIMAL_H
#define ANIMAL_H
#include <string>
#include <string_view>
#include <typeinfo>
class Animal
{
protected:
@DragonOsman
DragonOsman / Animal.h
Created April 8, 2020 21:47
Beginning C++17 book Chapter 14 Exercise 1 Solution files (headers and one source file)
#ifndef ANIMAL_H
#define ANIMAL_H
#include <string>
#include <string_view>
#include <typeinfo>
class Animal
{
private:
#ifndef BOX_H
#define BOX_H
#include <iostream>
#include <iomanip>
#include <algorithm>
class Box
{
private:
@DragonOsman
DragonOsman / index.html
Last active December 14, 2019 14:05
Solution for javascript.info task "Deposit Calculator" in Chapter "Events: change, input, cut, copy, paste"
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link href="styles/style.css">
</head>
<body>