Question

7. Given two strings char s1[??] = “first string” and s2[??] = “second string”. 7.1. How...

7. Given two strings char s1[??] = “first string” and s2[??] = “second string”. 7.1. How much storage should be declared for each of the strings?

8. What would the function strlen(“today is Wednesday”); return?

9. Given a byte in 2’s complement What is 0x56 in decimal? a) -13 b) −110 c) 38 d) 67 e) none of the above

10. Given a six bit integer in 2’s complement What is 100100 in decimal? a) -28 b) −24 c) -36 d) 24 e) none of the above

11. if x = 0x36 then which of the following statements is incorrect a) if y = 0x42 then x | y is 0x76 b) if y = 0x12 then x & y is 0x2 c) if y = 0x42 then x & y is 0x2 d) if y = 0x41 then x & y is 0x0 e) All statement are correct

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Thanks for the question.

Note:
As per Chegg strict policy & guidelines, I am only allowed to answer the first question with the first 4 subparts, please post the remaining questions as a separate post, and I will be happy to answer them. Sorry for the inconvenience caused.

===========================================================================

7.

in s1 array, we have 12 letters and we know that strings are ended with a null character so we need to count that as well, so the array size (storage) for s1 is 12+1=13

same way for s2, we have 13 letters, including the null character we end up with a size(storage) of 13+1=14

8.

strLen() function returns the total number so characters not including the null character so there are 18 letters from 't' to 'y', so it will return 18

9.

Since the leading number is 0, then we just need to convert the number to decimal so the answer will be
5*16+6=86

10.

-28

===========================================================================

Add a comment
Know the answer?
Add Answer to:
7. Given two strings char s1[??] = “first string” and s2[??] = “second string”. 7.1. How...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • You are given a list of strings L = {s1,s2 ...sn}. Each si is a string...

    You are given a list of strings L = {s1,s2 ...sn}. Each si is a string of up to 26 English characters. For example, L consists of the following strings: {s1, 82... Sn}. Each s; is a string of up to 26 English 13. You are given a list of of strings L = characters. For example L consists of the following strings: S1 =hello', S2 = 'world, s3 = 'what', s4 = 'a', 85 = 'nice', s6 = 'day',...

  • Consider the two strings "doggie dish" and "Drip coffee". What letters do they have in common?...

    Consider the two strings "doggie dish" and "Drip coffee". What letters do they have in common? That is, what is the letter intersection count for the pair of strings? Let's look at 'd' first. The first string has 2 d's (d's occurrence count is 2), while the second has just 1 d (capitalization doesn't count) - so the intersection for the strings for d is 1. What about g? There the occurrence counts are 2 and 0, so the intersection...

  • Question 1 An array is NOT: A - Made up of different data types. B - Subscripted by integers. C -...

    Question 1 An array is NOT: A - Made up of different data types. B - Subscripted by integers. C - A consecutive group of memory chunks. D - None of the choices. Question 2 How many times is the body of the loop executed? int i=1; while(true) { cout << i; if(++i==5) break; } A - Forever B - 4 C - 5 D - 6 E - 0 Question 3 What is wrong with the following piece of...

  • These are my answere to the following questions: are they right? 1. B 2. T 3....

    These are my answere to the following questions: are they right? 1. B 2. T 3. T 4. T 5. F 6. T 7. A 8. D 9. E 10. B 11. B 12. A 13. A 14. D 15. C 16. D 17. T 18. C 19. T 20. T 21. T 22. A 23. T 24. D 25. B 26. A 27. A 28. A 29. T 30. C 31. D 32. A 33. T 34. F 35....

  • Some java questions: 18. Consider the following class definitions public class TestAB public static void main (String a...

    Some java questions: 18. Consider the following class definitions public class TestAB public static void main (String args) A bl new B() в ь2 -new B() ; b1.х, А.у, Ь2.х, в.у); System.out.printf ("%d, Sd, %d, d\n", class A public int x = 2; public static int y = 4; public A () ( X=y- class Bextends A public int x = 32; public static int y = 45; public B ( x ++y What is the result of attempting to...

  • QUESTION 1 Given two double variables named x and y, which of the following statements could...

    QUESTION 1 Given two double variables named x and y, which of the following statements could you use to initialize both variables to a value of 0.0? a. x | y = 0.0; b. x = y = 0.0; c. x, y = 0.0; d. none of the above 1 points    QUESTION 2 When you use a range-based for loop with a vector, you a. can avoid out of bounds access b. must still use a counter variable c....

  • This C++ Program consists of: operator overloading, as well as experience with managing dynamic memory allocation...

    This C++ Program consists of: operator overloading, as well as experience with managing dynamic memory allocation inside a class. Task One common limitation of programming languages is that the built-in types are limited to smaller finite ranges of storage. For instance, the built-in int type in C++ is 4 bytes in most systems today, allowing for about 4 billion different numbers. The regular int splits this range between positive and negative numbers, but even an unsigned int (assuming 4 bytes)...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT