Programming in C
Programming in C
4th Edition
ISBN: 9780321776419
Author: Stephen G. Kochan
Publisher: Addison-Wesley
bartleby

Concept explainers

bartleby

Videos

Textbook Question
Book Icon
Chapter 8, Problem 4E

If you take the value of N as computed in exercise 2, subtract 621,049 from it, and then take that result modulo 7, you get a number from 0 to 6 that represents the day of the week (Sunday through Saturday, respectively) on which the particular day falls. For example, the value of N computed for August 8, 2004, is 732.239 as derived previously. 732,239 – 621,049 gives 111,190. and 111,190 % 7 gives 2, indicating that this date falls on a Tuesday.

Use the functions developed in the previous exercise to develop a program that displays the day of the week on which a particular date falls. Make certain that the program displays the day of the week in English (such as “Monday”).

Blurred answer
Students have asked these similar questions
The Problem A Zeckendorf number is defined for all positive integers as the number of Fibonacci numbers which must be added to equal a given number k. So, the positive integer 28 is the sum of three Fibonacci numbers (21, 5, and 2), so the Zeckendorf number for k = 28 is three. Wikipedia is a satisfactory reference for our purposes for more details of the Zeckendorf and Fibonacci numbers. In both cases, you do not need to read the entire Wikipedia entry. Your assignment is to write two ARM assembly language functions which calculate Zeckendorf and Fibonacci numbers. Zeck function The first function, which should be named zeck, receives an integer parameter in register zero. This will be the variable k we discussed above. Your code should return the Zeckendorf number for k in register zero when complete.   If the parameter k is zero, return zero. If the parameter k is negative, return minus 1. If the parameter k is too large to calculate, return minus 1. Fib function The other function,…
To represent an integer value of n in decimal, we need to use ⌈log10(n + 1)⌉ digits . Verify this using n = 35, 1290. Note that for any real number x, ⌈x⌉ is the smallest integer that is greater than x, this means we always round up. For example, ⌈10.3⌉ = 11, ⌈−5.2⌉ = −5. To represent an intege value of n in binary, we need to use ⌈log2(n + 1)⌉ binary digits . Verify this using n = 35, 1290. Use the definition of logarithmic function to show that log2n / log10n   = log210
Consider a base 26 number system wherein the letters of the alphabet are the digits. That is, A=0, B=1, C=2, … Z=25 in base 10. Use the MAL as a number in the base 26 system, and KHA as another number in the base 26 system.Add these numbers together to obtain the sum in based 26. Example 1 — if your first name is “Peter” and your surname is “Pan”, then add up PET26 and PAN26, and show the sum in base 26.Example 2 — if your first name is “Peter” and your surname is “Pa”, then add up PET26 and PAA26, and show the sum in base 26.

Additional Engineering Textbook Solutions

Find more solutions based on key concepts
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Computational Software for Intelligent System Design; Author: Cadence Design Systems;https://www.youtube.com/watch?v=dLXZ6bM--j0;License: Standard Youtube License