CJCoding With Joseph
15free / daySign inCreate account
TitleOpen
188
Call Through a Function PointerThe functions add and sub are provided.
easyNot startedSolve
670
Point at a Test Score and Print ItThe variable score is already declared and set to 87, and the first line of output is already written for you.
easyNot startedSolve
671
Double a Temperature Through a PointerThe program reads one integer temperature from input, and a pointer p that points at it is already set up.
easyNot startedSolve
672
Check for nullptr Before You DereferenceComplete the function report(int p): - if p is nullptr, print No target followed by a newline - otherwise print Target: followed by the value p points at, then a newline main is already written: it calls report once with a null pointer and once with the address of lives (which is 3).
easyNot startedSolve
673
Reference vs Pointer on the Same CounterA reference ref and a pointer ptr are already declared and both refer to the same count.
easyNot startedSolve
674
Prove the Pointer Holds the Right AddressTwo ints x and y are declared and p already points at x.
easyNot startedSolve
675
How Many Bytes Does a Pointer TakeThree pointers are already declared.
easyNot startedSolve
676
A const Pointer Locked to One Variablep is declared as int const p = &stock;.
easyNot startedSolve
677
Read a Player Struct Through an ArrowThe Player struct and the pointer ptr (which points at p) are already set up, and the program reads a name and a score from input.
easyNot startedSolve
678
Walk an Array of Prices with Pointer ArithmeticThe array prices and a pointer p to its first element are already declared.
easyNot startedSolve
679
Value, Reference, and Pointer Side by Sidemain is already written: int a = 5, b = 5, c = 5; addByValue(a); addByReference(b); addByPointer(&c); Fill in the bodies of addByValue(int n), addByReference(int &n) and addByPointer(int n) so each one adds 100 to the number it was handed.
easyNot startedSolve
680
Swap Two Inventory Counts by ReferenceWrite the body of void swapCounts(int &shelfA, int &shelfB) so it swaps the two integers it is given.
easyNot startedSolve
681
Swap a Morning and Evening Temperature with PointersWrite the body of void swapTemps(int morning, int evening) so it swaps the two integers the POINTERS point at.
easyNot startedSolve
682
Calibrate a SensorReading Struct Through a PointerA SensorReading struct is already declared with two int fields, id and celsius.
easyNot startedSolve
683
Print a Shelf Label Taken by Const ReferenceFill in void printLabel(const string &text).
easyNot startedSolve
684
Return a Reference to a Scoreboard SlotFill in int &slotAt(int scores[], int index) so it returns the element at position index.
easyNot startedSolve
685
Split Seconds into Minutes with Out-ParametersFill in void splitTime(int totalSeconds, int &minutes, int &seconds) with two assignments: - minutes = the number of whole minutes in totalSeconds - seconds = the leftover seconds main is already written: it reads one integer (a number of seconds) from input, declares minutes and seconds, calls splitTime(total, minutes, seconds), and prints them.
easyNot startedSolve
686
Return Locker Fields Using this->Complete the Locker class.
easyNot startedSolve
687
Heap Allocated Ticket CounterAllocate exactly ONE int on the heap holding the value 7 and store its address in the pointer ticketCount.
easyNot startedSolve
688
Heap Allocated Book RecordThe Book struct (a string title and an int pages) is already written for you.
easyNot startedSolve
689
Heap Array of Multiples of ThreeAllocate a heap array of SIZE (5) ints and store it in the pointer multiples.
easyNot startedSolve
690
Rainfall Average from a Heap Double ArrayAllocate a heap array of DAYS (4) doubles and store it in the pointer rainfall.
easyNot startedSolve
691
Update a Heap Sensor Through the Arrow OperatorThe Sensor struct (an int id and a double reading) is already written for you, and cout is already set to fixed with setprecision(2).
easyNot startedSolve
692
Array of Individually Allocated Score PointersIn the first loop, give each of the three slots of scores its own heap int holding the matching number out of the values array (88, 92 and 75).
easyNot startedSolve
693
Size a Heap Array from cin InputThe program already reads one integer n from input (n is always 1 or more).
easyNot startedSolve
694
makePoint Factory and the Caller DeletesThe Point struct (an int x and an int y) is already written.
easyNot startedSolve
732
Inventory Copy Constructor Deep-Copies the NamesInventory is written for you except its copy constructor.
easyNot startedSolve
736
AudioClip Move Constructor Steals the SamplesAudioClip is written for you except its move constructor.
easyNot startedSolve
189
Apply a Function Pointer TwiceWrite int applyTwice(int (f)(int), int x) that applies the one-argument function f to x, then applies f again to that result — in other words it returns f(f(x)).
mediumNot startedSolve
190
Transform an Array with a Function PointerWrite void mapArray(int arr[], int size, int (f)(int)) that replaces every element of arr with the result of calling f on it.
mediumNot startedSolve
695
SensorLog Owns Its Reading BufferWrite a class SensorLog that owns a heap-allocated array of temperature readings.
mediumNot startedSolve
696
TeamSheet Owns a new[] Array of PlayersPlayer is already written in the starter code - leave it as is.
mediumNot startedSolve
697
SeatingGrid Built with new int*[]Write a class SeatingGrid that owns a two-dimensional seating chart as an array of row pointers, each pointing at its own array of ints.
mediumNot startedSolve
698
Ticket Factory Returns a Heap TicketWrite a class Ticket plus a free (non-member) factory function that builds one on the heap.
mediumNot startedSolve
699
Playlist Assignment That Survives p = pWrite a class Playlist that owns a heap array of track lengths in seconds, with a copy assignment operator that is safe when an object is assigned to itself.
mediumNot startedSolve
700mediumNot startedSolve
701
NumberBag That Doubles Its BufferWrite a class NumberBag that grows its own storage — without std::vector.
mediumNot startedSolve
702
OrderBook Deletes Every Order PointerOrder is already written in the starter — leave it alone.
mediumNot startedSolve
703
Own One Score with make_uniqueRead one integer score from standard input.
mediumNot startedSolve
704
Weather Station Struct Behind a unique_ptrThe Station struct is already declared for you.
mediumNot startedSolve
705
Hand Off Ownership with std::moveRead one integer from standard input.
mediumNot startedSolve
706
Heap Array of Readings with unique_ptr<int[]>Read an integer n (always at least 1) followed by n integers.
mediumNot startedSolve
707
Watch use_count as Owners Join and LeaveRead one integer from standard input and follow these steps in order, printing a line after each: 1.
mediumNot startedSolve
708
Owner Count Falls Back After the Block EndsRead one integer from standard input and write a program that: 1.
mediumNot startedSolve
709
Tally Class with a unique_ptr MemberWrite a class named Tally that keeps its running total in an int on the heap, owned by a private std::unique_ptr<int> member.
mediumNot startedSolve
726
Shelf Stores Its Own CopiesBook is written for you; leave it alone.
mediumNot startedSolve
729
HoldQueue += Stores Each Address OnceBook is written for you; leave it alone.
mediumNot startedSolve
730
HoldQueue -= Shifts the Rest LeftBook and most of HoldQueue are written for you: the queue keeps the ADDRESSES of books in a const Book array it owns, operator+= already appends an address, and the destructor releases the array only.
mediumNot startedSolve
733
Roster Deep Copy of an Array of Player PointersPlayer and most of Roster are written for you.
mediumNot startedSolve
734
Car Copies Its Own EngineEngine and most of Car are written for you.
mediumNot startedSolve
737
Playlist Move Semantics Over an Array of Track PointersTrack and most of Playlist are written for you.
mediumNot startedSolve
738
Order Move Semantics With a String MemberOrder owns a heap array of quantities through the simple pointer m_quantities (one pointer, one array, one delete[]) and also has a plain string m_customer; an order whose customer is empty is INVALID and print says so.
mediumNot startedSolve
710
CharBuffer Rule of Three With a Self-Assignment GuardWrite a class CharBuffer that owns a C-style string on the heap.
hardNot startedSolve
711
Grid Matrix: operator() Over a Single Heap BufferWrite a class Grid that stores a rows x cols matrix of ints in ONE dynamically allocated block (not an array of arrays) and exposes its elements through operator().
hardNot startedSolve
712
NumberChain: A Linked List Whose Destructor Deletes Every NodeWrite a singly linked list class NumberChain that owns its nodes and deletes every one of them.
hardNot startedSolve
713hardNot startedSolve
714
TokenBuffer Move Constructor Leaves the Source EmptyWrite a class TokenBuffer that owns an int array on the heap and supports both COPYING (a deep copy) and MOVING (steal the pointer and leave the source owning nothing).
hardNot startedSolve
715
Binary Search Tree with Recursive TeardownBuild a binary search tree out of heap-allocated nodes, print it in order, then tear the whole thing down.
hardNot startedSolve
716
Ragged Heap Rows Printed BackwardsBuild a ragged (jagged) 2D structure on the heap - an array of row pointers where every row has its own length - print it, then release it.
hardNot startedSolve
717
IntStack Backed by a Doubling BufferWrite a class IntStack that keeps its elements in a raw heap buffer it grows by itself.
hardNot startedSolve
718
unique_ptr Expression Tree from PostfixBuild an expression tree from a postfix expression in which EVERY node is owned by a std::unique_ptr.
hardNot startedSolve
719
Return a Heap Array of Running MaximumsWrite exactly this function: int runningMax(const int values, int n); It returns a NEW array of n ints in which element i is the largest value found in values[0] through values[i].
hardNot startedSolve
727
Shelf Deep Copy With a Self-Assignment GuardBook is written for you; leave it alone.
hardNot startedSolve
728
Shelf Move Leaves the Source EmptyBook is written for you; leave it alone.
hardNot startedSolve
731
HoldQueue Copies Share the Books, Moves Empty the SourceBook is written for you; leave it alone.
hardNot startedSolve
735hardNot startedSolve
739
Garage Rule of Five Over an Array of Vehicle PointersVehicle is written for you; leave it alone.
hardNot startedSolve