2). Jane Walker, the manager of a construction company in a commercial city has his team working on a project. The team members work on many tasks. He divided the work such as the one third of his team works on design, half of the team is responsible for construction and the left over members in the team takes care of the maintenance. Write a C program using the appropriate variables and expressions as per the given data, read the number of members in the team and the number of days allotted for the completion of project. Display the complete schedule of the team as per the assigned number of days in the scenario to finish the project. Sample Input and Output: Enter the number of days required to complete the project:25 Enter the team size:50 For a team having 50 members, 16 people will work on design 25 people will be responsible for construction and 9 takes care of maitenance of the project that shall be completed in 25 days. ...Program finished with exit code 0 Press ENTER to exit console.]

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter2: Basic Elements Of C++
Section: Chapter Questions
Problem 5PE
icon
Related questions
Question

 use c_compiler

2). Jane Walker, the manager of a construction company in a commercial city has his team
working on a project. The team members work on many tasks. He divided the work such as the one
third of his team works on design, half of the team is responsible for construction and the left over
members in the team takes care of the maintenance. Write a C program using the appropriate
variables and expressions as per the given data, read the number of members in the team and the
number of days allotted for the completion of project. Display the complete schedule of the team as
per the assigned number of days in the scenario to finish the project.
Sample Input and Output:
Enter the number of days required to complete the project:25
Enter the team size:50
For a team having 50 members,
16 people will work on design
25 people will be responsible for construction and
9 takes care of maitenance of the project that shall be completed in 25 days.
...Program finished with exit code 0
Press ENTER to exit console.]
Transcribed Image Text:2). Jane Walker, the manager of a construction company in a commercial city has his team working on a project. The team members work on many tasks. He divided the work such as the one third of his team works on design, half of the team is responsible for construction and the left over members in the team takes care of the maintenance. Write a C program using the appropriate variables and expressions as per the given data, read the number of members in the team and the number of days allotted for the completion of project. Display the complete schedule of the team as per the assigned number of days in the scenario to finish the project. Sample Input and Output: Enter the number of days required to complete the project:25 Enter the team size:50 For a team having 50 members, 16 people will work on design 25 people will be responsible for construction and 9 takes care of maitenance of the project that shall be completed in 25 days. ...Program finished with exit code 0 Press ENTER to exit console.]
Expert Solution
Program Approach –
  • Take a variable to store the number of days.
  • Take a variable to store the size of the team.
  • Take a variable to store the one-third of the team.
  • Take a variable to store half of the team.
  • Take a variable to store the reaming people of the team.
  • Input the number of days.
  • Input the size of the team.
  • Divide the size of the team by 3 to get the one-third of the team.
  • Divide the size of the team by 2 to get the half of the team.
  • Subtract the one-third from the half to get the remaining of the team.
  • Print the values.
Program –

#include <stdio.h>

 

int main(void)

{

    int days; // number of the days

    int teamSize; // size of the team

    int oneThird; // one third of the team

    int half; // half of the team

    int remaining; // remaining people of the team

   

    // inserting the days

    printf(" Enter the number of days required to complete the project:");

    scanf("%d", &days);

   

    // inserting the team size

    printf(" Enter the team size:");

    scanf("%d", &teamSize);

   

    // calculating the one third of the team

    oneThird = teamSize / 3;

   

    // calculating the half of the team

    half = teamSize / 2;

   

    // calculating the remaining people of the team

    remaining = half - oneThird;

   

    // printing the data

    printf("\n\n For a team having %d members,\n", teamSize);

    printf("\n %d people will work on design\n", oneThird);

    printf("\n %d people will be responsible for construction and\n", half);

    printf("\n %d takes care of maintenance of the project that shall be completed in %d days.", remaining, days);

}

steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Knowledge Booster
Introduction to computer system
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
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr