CJCoding With Joseph
15free / daySign inCreate account
TitleTopicsAction
188
Call Through a Function PointerThe functions add and sub are provided. Complete apply(int (*op)(int, int), int ...
easy○ Not Started
Function PointersPointers
Solve
670
Point at a Test Score and Print ItThe variable `score` is already declared and set to 87, and the first line of ou...
easy○ Not Started
Pointers
Solve
671
Double a Temperature Through a PointerThe program reads one integer temperature from input, and a pointer `p` that poi...
easy○ Not Started
Pointers
Solve
672
Check for nullptr Before You DereferenceComplete the function `report(int* p)`: - if `p` is `nullptr`, print `No target`...
easy○ Not Started
Pointers
Solve
673
Reference vs Pointer on the Same CounterA reference `ref` and a pointer `ptr` are already declared and both refer to the...
easy○ Not Started
Pointers
Solve
674
Prove the Pointer Holds the Right AddressTwo ints `x` and `y` are declared and `p` already points at `x`. The value check...
easy○ Not Started
Pointers
Solve
675
How Many Bytes Does a Pointer TakeThree pointers are already declared. Print the size of each one; the `int` line ...
easy○ Not Started
Pointers
Solve
676
A const Pointer Locked to One Variable`p` is declared as `int* const p = &stock;`. The program reads one integer from ...
easy○ Not Started
Pointers
Solve
677
Read a Player Struct Through an ArrowThe `Player` struct and the pointer `ptr` (which points at `p`) are already set ...
easy○ Not Started
Pointers
Solve
678
Walk an Array of Prices with Pointer ArithmeticThe array `prices` and a pointer `p` to its first element are already declared. ...
easy○ Not Started
Pointers
Solve
679
Value, Reference, and Pointer Side by Sidemain is already written: int a = 5, b = 5, c = 5; addByValue(a); ad...
easy○ Not Started
Pointers
Solve
680
Swap Two Inventory Counts by ReferenceWrite the body of void swapCounts(int &shelfA, int &shelfB) so it swaps the two ...
easy○ Not Started
Pointers
Solve
681
Swap a Morning and Evening Temperature with PointersWrite the body of void swapTemps(int *morning, int *evening) so it swaps the two...
easy○ Not Started
Pointers
Solve
682
Calibrate a SensorReading Struct Through a PointerA SensorReading struct is already declared with two int fields, id and celsius. ...
easy○ Not Started
Pointers
Solve
683
Print a Shelf Label Taken by Const ReferenceFill in void printLabel(const string &text). main is already written: it reads ...
easy○ Not Started
Pointers
Solve
684
Return a Reference to a Scoreboard SlotFill in int &slotAt(int scores[], int index) so it returns the element at positi...
easy○ Not Started
Pointers
Solve
685
Split Seconds into Minutes with Out-ParametersFill in void splitTime(int totalSeconds, int &minutes, int &seconds) with two as...
easy○ Not Started
Pointers
Solve
686
Return Locker Fields Using this->Complete the Locker class. It has two private int fields, lockerId and itemCount...
easy○ Not Started
Pointers
Solve
687
Heap Allocated Ticket CounterAllocate exactly ONE int on the heap holding the value 7 and store its address i...
easy○ Not Started
Pointers
Solve
688
Heap Allocated Book RecordThe Book struct (a string title and an int pages) is already written for you. A...
easy○ Not Started
Pointers
Solve
689
Heap Array of Multiples of ThreeAllocate a heap array of SIZE (5) ints and store it in the pointer multiples. Fi...
easy○ Not Started
Pointers
Solve
690
Rainfall Average from a Heap Double ArrayAllocate a heap array of DAYS (4) doubles and store it in the pointer rainfall. ...
easy○ Not Started
Pointers
Solve
691
Update a Heap Sensor Through the Arrow OperatorThe Sensor struct (an int id and a double reading) is already written for you, a...
easy○ Not Started
Pointers
Solve
692
Array of Individually Allocated Score PointersIn the first loop, give each of the three slots of scores its own heap int holdi...
easy○ Not Started
Pointers
Solve
693
Size a Heap Array from cin InputThe program already reads one integer n from input (n is always 1 or more). Allo...
easy○ Not Started
Pointers
Solve
694
makePoint Factory and the Caller DeletesThe Point struct (an int x and an int y) is already written. Finish makePoint so...
easy○ Not Started
Pointers
Solve
732
Inventory Copy Constructor Deep-Copies the Names`Inventory` is written for you except its copy constructor. `m_items` is a simpl...
easy○ Not Started
Pointers
Solve
736
AudioClip Move Constructor Steals the Samples`AudioClip` is written for you except its move constructor. `m_samples` is a sim...
easy○ Not Started
Pointers
Solve
189
Apply a Function Pointer TwiceWrite int applyTwice(int (*f)(int), int x) that applies the one-argument functio...
medium○ Not Started
Function PointersPointers
Solve
190
Transform an Array with a Function PointerWrite void mapArray(int arr[], int size, int (*f)(int)) that replaces every elem...
medium○ Not Started
Function PointersPointers
Solve
695
SensorLog Owns Its Reading BufferWrite a class `SensorLog` that owns a heap-allocated array of temperature readin...
medium○ Not Started
Pointers
Solve
696
TeamSheet Owns a new[] Array of Players`Player` is already written in the starter code - leave it as is. Write the clas...
medium○ Not Started
Pointers
Solve
697
SeatingGrid Built with new int*[]Write a class `SeatingGrid` that owns a two-dimensional seating chart as an arra...
medium○ Not Started
Pointers
Solve
698
Ticket Factory Returns a Heap TicketWrite a class `Ticket` plus a free (non-member) factory function that builds one...
medium○ Not Started
Pointers
Solve
699
Playlist Assignment That Survives p = pWrite a class `Playlist` that owns a heap array of track lengths in seconds, wit...
medium○ Not Started
Pointers
Solve
700
Printer Deletes Its Own CartridgeWrite TWO classes. `Printer` owns a `Cartridge` that it creates on the heap in i...
medium○ Not Started
Pointers
Solve
701
NumberBag That Doubles Its BufferWrite a class `NumberBag` that grows its own storage — without `std::vector`. P...
medium○ Not Started
Pointers
Solve
702
OrderBook Deletes Every Order Pointer`Order` is already written in the starter — leave it alone. Write `OrderBook`, w...
medium○ Not Started
Pointers
Solve
703
Own One Score with make_uniqueRead one integer score from standard input. Hand it to a `unique_ptr<int>` built...
medium○ Not Started
Pointers
Solve
704
Weather Station Struct Behind a unique_ptrThe `Station` struct is already declared for you. Read a one-word city name and ...
medium○ Not Started
Pointers
Solve
705
Hand Off Ownership with std::moveRead one integer from standard input. Create a `unique_ptr<int>` named `first` t...
medium○ Not Started
Pointers
Solve
706
Heap Array of Readings with unique_ptr<int[]>Read an integer `n` (always at least 1) followed by `n` integers. Store the valu...
medium○ Not Started
Pointers
Solve
707
Watch use_count as Owners Join and LeaveRead one integer from standard input and follow these steps in order, printing a...
medium○ Not Started
Pointers
Solve
708
Owner Count Falls Back After the Block EndsRead one integer from standard input and write a program that: 1. Creates `owner...
medium○ Not Started
Pointers
Solve
709
Tally Class with a unique_ptr MemberWrite a class named `Tally` that keeps its running total in an `int` **on the he...
medium○ Not Started
Pointers
Solve
726
Shelf Stores Its Own Copies`Book` is written for you; leave it alone. Write the class `Shelf`, which keeps ...
medium○ Not Started
Pointers
Solve
729
HoldQueue += Stores Each Address Once`Book` is written for you; leave it alone. Complete the class `HoldQueue`, which...
medium○ Not Started
PointersOperator Overloading
Solve
730
HoldQueue -= Shifts the Rest Left`Book` and most of `HoldQueue` are written for you: the queue keeps the ADDRESSE...
medium○ Not Started
PointersOperator Overloading
Solve
733
Roster Deep Copy of an Array of Player Pointers`Player` and most of `Roster` are written for you. `m_players` is a pointer to a...
medium○ Not Started
Pointers
Solve
734
Car Copies Its Own Engine`Engine` and most of `Car` are written for you. `m_engine` is a simple pointer t...
medium○ Not Started
Pointers
Solve
737
Playlist Move Semantics Over an Array of Track Pointers`Track` and most of `Playlist` are written for you. `m_tracks` is a pointer to a...
medium○ Not Started
Pointers
Solve
738
Order Move Semantics With a String Member`Order` owns a heap array of quantities through the simple pointer `m_quantities...
medium○ Not Started
Pointers
Solve
710
CharBuffer Rule of Three With a Self-Assignment GuardWrite a class CharBuffer that owns a C-style string on the heap. Do NOT write a ...
hard○ Not Started
Pointers
Solve
711
Grid Matrix: operator() Over a Single Heap BufferWrite a class Grid that stores a rows x cols matrix of ints in ONE dynamically a...
hard○ Not Started
Pointers
Solve
712
NumberChain: A Linked List Whose Destructor Deletes Every NodeWrite a singly linked list class NumberChain that owns its nodes and deletes eve...
hard○ Not Started
Pointers
Solve
713
Buffered Device Deleted Through a Base PointerWrite two classes. Do NOT write a main function; a hidden test provides one. cl...
hard○ Not Started
Pointers
Solve
714
TokenBuffer Move Constructor Leaves the Source EmptyWrite a class TokenBuffer that owns an int array on the heap and supports both C...
hard○ Not Started
Pointers
Solve
715
Binary Search Tree with Recursive TeardownBuild a binary search tree out of heap-allocated nodes, print it in order, then ...
hard○ Not Started
Pointers
Solve
716
Ragged Heap Rows Printed BackwardsBuild a ragged (jagged) 2D structure on the heap - an array of row pointers wher...
hard○ Not Started
Pointers
Solve
717
IntStack Backed by a Doubling BufferWrite a class `IntStack` that keeps its elements in a raw heap buffer it grows b...
hard○ Not Started
Pointers
Solve
718
unique_ptr Expression Tree from PostfixBuild an expression tree from a postfix expression in which EVERY node is owned ...
hard○ Not Started
Pointers
Solve
719
Return a Heap Array of Running MaximumsWrite exactly this function: int* runningMax(const int* values, int n); It ret...
hard○ Not Started
Pointers
Solve
727
Shelf Deep Copy With a Self-Assignment Guard`Book` is written for you; leave it alone. Write the class `Shelf`, which owns c...
hard○ Not Started
Pointers
Solve
728
Shelf Move Leaves the Source Empty`Book` is written for you; leave it alone. Write the class `Shelf`, which owns c...
hard○ Not Started
Pointers
Solve
731
HoldQueue Copies Share the Books, Moves Empty the Source`Book` is written for you; leave it alone. Write the class `HoldQueue`, which ke...
hard○ Not Started
Pointers
Solve
735
Portfolio Rule of Three With Two Resources`Holding` is written for you. Write the class `Portfolio`, which owns TWO heap r...
hard○ Not Started
Pointers
Solve
739
Garage Rule of Five Over an Array of Vehicle Pointers`Vehicle` is written for you; leave it alone. Write the class `Garage`, which ow...
hard○ Not Started
Pointers
Solve