Skip to content

Instantly share code, notes, and snippets.

View DragonOsman's full-sized avatar

Osman Zakir DragonOsman

View GitHub Profile
// Osman Zakir
// 1 / 18 / 2022
// Beginning C++20: From Novice to Professional by Ivor Horton and Peter Van Weert
// Chapter 11 Exercise 3
// Exercise Specs:
/**
* Split the insanely large words module of Exercise 11-2 into two aptly
* named submodules: one submodule containing all sorting functionality, and one
* containing any remaining utilities (or utils, in programmer’s speak). Also put your
* functions in nested namespaces whose names mirror those of the submodules.
// Osman Zakir
// 1 / 6 / 2022
// Beginning C++20: From Novice to Professional by Ivor Horton and Peter Van Weert
// Chapter 11 Exercise 1
// Exercise Specs:
/**
* One of the larger programs you have seen thus far is that of Ex8_18.
* cpp. Extract all its functions and put them in a single-file words module, with all
* functions part of a words namespace. The module should only export those functions
* that are relevant to the main() function, which for the most part should be kept as is.
1>E:\programming\visual_studio_2019\Projects\beginningcpp20\chapter10ex3\chapter10ex3\chapter10ex3.cpp(38,15): error C2672: 'plus': no matching overloaded function found
1>E:\programming\visual_studio_2019\Projects\beginningcpp20\chapter10ex3\chapter10ex3\chapter10ex3.cpp(38,15): error C2783: 'ReturnType plus(const T1 *,const T2 *)': could not deduce template argument for 'ReturnType'
1>E:\programming\visual_studio_2019\Projects\beginningcpp20\chapter10ex3\chapter10ex3\chapter10ex3.cpp(22): message : see declaration of 'plus'
1>E:\programming\visual_studio_2019\Projects\beginningcpp20\chapter10ex3\chapter10ex3\chapter10ex3.cpp(38,15): error C2783: 'ReturnType plus(const T1 &,const T2 &)': could not deduce template argument for 'ReturnType'
1>E:\programming\visual_studio_2019\Projects\beginningcpp20\chapter10ex3\chapter10ex3\chapter10ex3.cpp(19): message : see declaration of 'plus'
1>E:\programming\visual_studio_2019\Projects\beginningcpp20\chapter10ex3\chapter10ex3\chapter10ex3.cpp(56,1): error C2397: convers
// Osman Zakir
// 12 / 21 / 2021
// Beginning C++20: From Novice to Professional by Ivor Horton and Peter Van Weert
// Chapter 8 Exercise 1
// Exercise Specs:
/**
* Write a function, validate_input(), that accepts two integer arguments that
* represent the upper and lower limits for an integer that is to be entered.
* It should accept a third argument that is a string describing the input,
* with the string being used in the prompt for input to be entered. The
// Osman Zakir
// 12 / 12 / 2021
// Beginning C++20: From Novice to Professional by Ivor Horton and Peter Van Weert
// Chapter 7 Exercise 8
// Exercise Specs:
/**
* A tautogram is a body of text in which all words start with the same letter. In
* English, an example would be “truly tautograms triumph, trumpeting trills to trounce terrible
* travesties.” Ask the user for a string, and verify whether it is a tautogram (ignoring casing). If
* it is, output also the letter by which each word starts.
1>E:\programming\visual_studio_2019\Projects\beginningcpp20\chapter7ex6\chapter7ex6\chapter7ex6.cpp(80,34): error C2062: type 'auto' unexpected
1>E:\programming\visual_studio_2019\Projects\beginningcpp20\chapter7ex6\chapter7ex6\chapter7ex6.cpp(80,34): error C2065: '<range>$L1': undeclared identifier
1>E:\programming\visual_studio_2019\Projects\beginningcpp20\chapter7ex6\chapter7ex6\chapter7ex6.cpp(80,47): error C3536: '<begin>$L1': cannot be used before it is initialized
1>E:\programming\visual_studio_2019\Projects\beginningcpp20\chapter7ex6\chapter7ex6\chapter7ex6.cpp(80,47): error C3536: '<end>$L1': cannot be used before it is initialized
1>E:\programming\visual_studio_2019\Projects\beginningcpp20\chapter7ex6\chapter7ex6\chapter7ex6.cpp(80,47): error C2100: illegal indirection
1>E:\programming\visual_studio_2019\Projects\beginningcpp20\chapter7ex6\chapter7ex6\chapter7ex6.cpp(80,47): error C2440: 'initializing': cannot convert from 'int' to 'const std::string &'
1>E:\programming\visual_studio_2019\Projects\b
// Osman Zakir
// 12 / 10 / 2021
// Beginning C++20: From Novice to Profesional by Ivor Horton and Peter Van Weert
// Chapter 7 Exercise 6
// Exercise Specs:
/**
* Write a program that reads a text string of arbitrary length from the keyboard
* followed by a string containing one or more letters. Output a list of all the
* whole words in the text that begin with any of the letters, uppercase or lowercase.
*/
// Osman Zakir
// 12 / 7 / 2021
// Beginning C++20: From Novice to Professional by Ivor Horton and Peter Van Weert
// Chapter 7 Exercise 2
// Exercise Specs:
/**
* Write a program that reads text entered over an arbitrary number of lines. Find
* and record each unique word that appears in the text and record the number of occurrences
* of each word. Output the words and their occurrence counts. Words and counts should align
* in columns. The words should align to the left; the counts to the right. There should be three
// Osman Zakir
// 11 / 29 / 2021
// Beginning C++20: From Novice to Professional by Ivor Horton and Peter Van Weert
// Chapter 6 Exercise 1
// Exercise Specs:
/**
* Write a program that declares and initializes an array with the first 50 odd (as in
* not even) numbers. Output the numbers from the array ten to a line using pointer notation and
* then output them in reverse order, also using pointer notation.
*/
// Osman Zakir
// 11 / 29 / 2021
// Beginning C++20: From Novice to Professional by Ivor Horton and Peter Van Weert
// Chapter 6 Example Code 7
// Using smart pointers
import <iostream>;
import <format>;
import <memory>;
import <vector>;