Program Input: The number of days to be converted Program Output: Three numbers that represent how many years, weeks, and remaining days are in the given number of days, respectively. Sample Testcase 0:

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
I need help
Sample Testcase 0:
Input:
2104
Output:
5 39 6
#include<iostream>
3
4
using namespace std;
6.
int main()
7
{
8
Double y;
9.
int d,w;
10
11
cin>>d;
12
y=Dd/365.0;
d=Dd%365;
w=d%7;
13
14
15
16
d=d/7;
17
18
cout<<y<<" "<<w<<" "<<d<<
n";
19
20
return 0;
21 }
Transcribed Image Text:Sample Testcase 0: Input: 2104 Output: 5 39 6 #include<iostream> 3 4 using namespace std; 6. int main() 7 { 8 Double y; 9. int d,w; 10 11 cin>>d; 12 y=Dd/365.0; d=Dd%365; w=d%7; 13 14 15 16 d=d/7; 17 18 cout<<y<<" "<<w<<" "<<d<< n"; 19 20 return 0; 21 }
The code box below shows a simple C++
program. The program is supposed to convert
any inserted number of days into years , weeks,
and remaining days that will be printed out. For
instance, 1234 days will represnt 3 years, 19
weeks, and 6 days. However, the program has a
number of both logical and syntax errors that
need to be fixed in order for it to work properly.
Find and fix these errors in order to get a correct
output.
(Hint: Always assume a year is exactly 365 days.)
IMPORTANT NOTE
• Do not add any cout statements
except for the final answer as specified
above.
• Do not add couts for "Enter a
number", "the number of days is" or
any similar prompts.
• Also note that the automatic grader is
case-sensitive; so "error" is wrong but
"ERROR" is correct.
• Do not add any unnecessary spaces
inside the strings of cout statements "
• You may add any libraries needed.
1/0
Program Input:
The number of days to be converted
Program Output:
Three numbers that represent how many
years, weeks, and remaining days are in the
given number of days, respectively.
Sample Testcase 0:
Transcribed Image Text:The code box below shows a simple C++ program. The program is supposed to convert any inserted number of days into years , weeks, and remaining days that will be printed out. For instance, 1234 days will represnt 3 years, 19 weeks, and 6 days. However, the program has a number of both logical and syntax errors that need to be fixed in order for it to work properly. Find and fix these errors in order to get a correct output. (Hint: Always assume a year is exactly 365 days.) IMPORTANT NOTE • Do not add any cout statements except for the final answer as specified above. • Do not add couts for "Enter a number", "the number of days is" or any similar prompts. • Also note that the automatic grader is case-sensitive; so "error" is wrong but "ERROR" is correct. • Do not add any unnecessary spaces inside the strings of cout statements " • You may add any libraries needed. 1/0 Program Input: The number of days to be converted Program Output: Three numbers that represent how many years, weeks, and remaining days are in the given number of days, respectively. Sample Testcase 0:
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY