MCPcopy Create free account
hub / github.com/Apress/beginning-cpp20 / main

Function main

Examples/NoModules/Chapter 14/Ex14_02/Ex14_02.cpp:5–17  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3#include "Carton.h" // For the Carton class
4
5int main()
6{
7 // Create four Carton objects
8 Carton carton1; std::cout << std::endl;
9 Carton carton2 {"White-lined chipboard"}; std::cout << std::endl;
10 Carton carton3 {4.0, 5.0, 6.0, "PET"}; std::cout << std::endl;
11 Carton carton4 {2.0, "Folding boxboard"}; std::cout << std::endl;
12
13 std::cout << "carton1 volume is " << carton1.volume() << std::endl;
14 std::cout << "carton2 volume is " << carton2.volume() << std::endl;
15 std::cout << "carton3 volume is " << carton3.volume() << std::endl;
16 std::cout << "carton4 volume is " << carton4.volume() << std::endl;
17}

Callers

nothing calls this directly

Calls 1

volumeMethod · 0.45

Tested by

no test coverage detected