Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please help with this partitions assignment Instructions: Answer the following q

ID: 3599804 • Letter: P

Question

Please help with this partitions assignment

Instructions: Answer the following questions on a separate sheet of paper (typed or hand-written), numbering all answers and showing all work for full credit. Answer the two questions below regarding data structures and endian ordering using Figure 1 below 1. 00000400 00 00 00 A0 07 00 04 00 00 00 30 31 30 30 01 AO 00000416 03 00 01 00 00 00 01 00 00 00 02 A0 03 00 01 00 00000432 00 00 80 OD 00 00 03 A0 03 00 01 00 00 00 00 09 I 00000448 00 00 05 A0 04 00 01 00 00 00 0E 24 00 00 0E A2 00000464 05 00 01 00 00 00 2C 24 00 00 OF A2 05 00 01 00 00000480 00 00 34 24 00 00 10 A2 03 00 01 00 00 00 02 004S. . .c 0100 Figure 1 Suppose you were told that the horizontal resolution of a digital photograph taken is stored as a 16bit number at offset 434. Su were told that the file format dictates big endian ordering. What is the horizontal resolution of the digital photograph in hex and decimal? a. ppose you b. Again, suppose you were told that the horizontal resolution of a digital photograph taken is stored as a 16bit number at offset 434. But this time, suppose you were told that the processor is Intel x86 and that the file format does not "trump" the normal little endian ordering that would then be presumed. What is the horizontal resolution of the digital photograph in hex and decimal? What if you were told that the horizontal resolution is stored as a 32bit number, presuming big endian ordering? What is the resolution in hex and decimal? c. d. What if you were told that the horizontal resolution is stored as a 32bit number, presuming little endian ordering? What is the resolution in hex and decimal?

Explanation / Answer

class String {
public:
String        ();                         //Empty string
String        (char);                     //Stirng('x')
String        (const char[]);             //String("abcd")
char&   operator[]    (int);                      //Accessor/Modifier
char    operator[]    (int)                const; //Accessor
int     capacity      ()                   const; //Max chars that can be stored (not including null terminator)
int     length        ()                   const; //Number of char in string
String operator+     (const String&)      const; //Concatenation
String& operator+=    (String);                   //Concatenation
bool    operator==    (const String&)      const;
bool    operator<     (const String&)      const;
String substr        (int, int)           const;
int     findch        (int, char)          const;
int     findstr       (int, const String&) const;

friend std::istream& operator>>(std::istream&, String&);
friend std::ostream& operator<<(std::ostream&, const String&);

private:
char str[STRING_SIZE];
};

String operator+       (const char[], const String&);
String operator+       (char,          const String&);
bool    operator==      (const char[], const String&);
bool    operator==      (char,          const String&);
bool    operator<       (const char[], const String&);
bool    operator<       (char,          const String&);
bool    operator<=      (const String&, const String&);
bool    operator!=      (const String&, const String&);
bool    operator>=      (const String&, const String&);
bool    operator>       (const String&, const String&);

#endif

Makefile

###############################################################
# String & Oracle
#
# CS II Kent State University
# Make file for string class and testing oracle
# J. Maletic Fall 2017
#
#

###############################################################
# Variables
CPP     = clang++
OPTIONS = -g -Wall -W -Wunused -Wuninitialized -Wshadow -std=c++11


# Names of your test files - add them in as you build them.
# Names must start with "test_"
MYTESTS = test_default_ctor test_c_str_ctor
#test_ctor_charArray


# Names of test files (include or exclude ones you don't want) testoracle_split
CTOR = testoracle_ctor_default testoracle_ctor_char testoracle_ctor_charArray
REL = testoracle_equal testoracle_lessThan
COPY = testoracle_ctor_copy testoracle_assign testoracle_ctor_charArray_int testoracle_ctor_int testoracle_swap_assign
OPS = testoracle_concat testoracle_subscript testoracle_len_cap testoracle_input testoracle_find_char testoracle_find_string testoracle_substring