In C++ Implement a class 14. Inventory Bins p. Define the operators >, =.

Question: In C++ Implement a class 14. Inventory Bins p. Define the operators <<, >>, =.

Inventory Bins Write a program that simulates inventory bins in a warehouse. Each bin holds a number of the same type of parts. The program should use a structure that keeps the following data: Description of the part kept in the bin Number of parts in the bin The program should have an array of 10 bins, initialized with the following data

Solution:

#include<iostream>


using namespace std;

class InventoryBin{
string desc;
int noOfPart;

public:
  InventoryBin(){
   desc = “”;
   noOfPart = 0;
  }
  InventoryBin(string des){
   desc = des;
   noOfPart = 0;
  }
  InventoryBin(string des,int n){
   desc = des;
   if(n > 0 && n <= 30){
    noOfPart = n;
   }
  }
  void addPart(int n){
   if(n > 0 && 30 >= noOfPart+n){
    noOfPart += n;
   }
   else
   cout<<“\n count may be negative or it add to become above 30 “;
  }
  void removePart(int n){
   if(n > 0 && 0 <= noOfPart-n){
    noOfPart -= n;
   }
   else
   cout<<“\n count is negative or it will became negative “;
  }
  
  friend ostream& operator<<(ostream &out,const InventoryBin &oth){
   out<<oth.desc<<” \t\t\t “<<oth.noOfPart;
   
   return out;
  }
  void operator=(const InventoryBin &oth){
   desc = oth.desc;
   noOfPart = oth.noOfPart;
  }
  friend istream& operator>>(istream &in,InventoryBin &oth){
   in>>oth.desc;
   in>>oth.noOfPart;
   
   return in;
  }
};

void printInventory(InventoryBin in[10]){
system(“cls”);
cout<<“—————————————————————————–“;
cout<<“\nslNo. \t Part Description    \t   Number Of Parts in the Bin\n”;
cout<<“—————————————————————————–\n”;
for(int i = 0;i<10;i++){
  cout<<i+1<<” \t “<<in[i]<<endl;
}
}

void select(InventoryBin &in){
char ch = ‘0’;
while(ch != ‘3’){
  cout<<“\n 1. add “;
  cout<<“\n 2. remove”;
  cout<<“\n 3. back “;
  cout<<“\nchoose : “;
  cin>>ch;
  if(ch == ‘1’){
   cout<<“\n enter the no. of part to add : “;
   int n;
   cin>>n;
   in.addPart(n);
  }
  if(ch == ‘2’){
   cout<<“\n enter the no. of part to remove : “;
   int n;
   cin>>n;
   in.removePart(n);
  }
}

}

int main()
{
InventoryBin in[10];
in[0] = InventoryBin(“Value         “,10);
in[1] = InventoryBin(“Bearing       “,5);
in[2] = InventoryBin(“Bushing       “,15);
in[3] = InventoryBin(“Coupling      “,21);
in[4] = InventoryBin(“Flange        “,7);
in[5] = InventoryBin(“Gear          “,5);
in[6] = InventoryBin(“Gear Housing “,5);
in[7] = InventoryBin(“Vacuum Gripper”,25);
in[8] = InventoryBin(“Cable         “,18);
in[9] = InventoryBin(“Rod           “,12);

char ch = ‘ ‘;
while(ch != ‘q’){
  printInventory(in);
  cout<<“\n\nChoose from above sl no. to select the Inventory or press ‘q’ to quit the program”;
  cin>>ch;
  if(ch > ‘0’ && ch < ‘9’)
   select(in[(int)(ch – ‘0’)-1]);
}
}

Software Engineering: A Practitioner’s Approach Chapter 23, Problem 4P

Question: Software for System X has 24 individual functional requirements and 14 nonfunctional requirements. What is the specificity of the requirements? The completeness?

Solution:

Soft are for system X has 24 individual functional requirements and 14 non functional requirements.

functional requirements

Non – functional requirements

=38

To determine the specificity ( lack of ambiguity ) of requirements

A metric that is based on the consistency of the reviewers interpretation of each requirement.

Where

is the number of requirements for which all reviewers had identical interpretations. The closer the value of to 1, the lower is the ambiguity of the specification.

The completeness of functional requirements can be determined by computing the ratio

Where

is the number of unique function requirements, is the number of inputs defined or implied by the specification and is the number of states specified.

XYZ, a software house is considering developing a payroll application for use in academic institutions

Question: XYZ, a software house is considering developing a payroll application for use in academic institutions and is currently engaged in a cost-benefit analysis. Study of the market has shown that, if XYZ can target it efficiently and no competing products become available, it will obtain a high level of sales generating an annual income of $800,000. It estimates that there is a 1 in 10 chance of happening. However, a competitor might launch a competing application before its own launch dates and then sales might generate only $100,000 per year. It estimates that there is a 30% chance of this happening. The most likely outcome it believes, is somewhere between these two extremes – it will gain a market lead by launching before any competitor product becomes available and achieve an annual income of $650,000. Initially, draw a table presenting the expected value ($) for high, medium and low sales. Show the total expected income. Development costs are estimated at $750,000. Sales levels are expected to be constant for at least four years. Annual costs of marketing and product maintenance are estimated at $200,000, irrespective of market share. Would you advise going ahead with the project? Give detailed explanation.

Solution:

Income,Expected Value

High Sale, 1/10 * 800,000 = $80,000

Sale Low, 3/10*100,000 = $30,000

Medium Sale, 6/10*650,000 = $390,000

Expected Sales Level = 1/10*800,000 + 3/10*100,000 + 6/10*650,000

= $80,000 +  $30,000 + $390,000

= $500,000

Development Cost = $750,000

Annual Cost = $200,000

Total Cost over four years

= development cost + 4* Annual Cost

= $750,000 + $800,000

= $1,550,000

Total revenue over 4 years = $2,000,000

Profit = $450,000

Yes it is advisable to go ahead with the project as the firm is operating in profit.

A new project has an average novelty for the software supplier that is going to execute it.

Question: A new project has an average novelty for the software supplier that is going to execute it. Development flexibility is high, and requirements may change radically. The development team is all located at the same office and the software house as a whole tends to be formal in its standards and procedures. The product should be very reliable, and the algorithms are complex. The supplier would like to reuse the project with suitable modifications on further contracts. Developers are familiar with the platform and they are capable of conducting this specific type of project. The toolsets available to the development team are judged to be typical for this size of company, as is the degree of schedule pressure to meet a deadline. a. What would be the scale factor in this case? b. What would be the estimate of effort if the size of the application was estimated as in the region of 2000 lines of code? c. What would be the impact of all the effort multipliers on the project estimation?

Solution:

The success of a software project depends on the stakeholder. A stakeholder outside the project organization can see success in terms of the final cost and time incurred while the internal stakeholders can find success in meeting the scope of the project. So we can say that project success criteria varies with the different groups of stakeholders.


A project is defined successful when it passes the quality checks meeting all the quality requirements,cost,time-lines and the agreed scope.
But if a project meets all these does not guarantees to be a successful one,there are projects that do not meet these requirements but are still successful.

successful projects are completed within time,budget,scope,performance requirements and user acceptance testing(UAT).

The main reason of a project failure is poor project management. Most of the factors like limited use of automation testing, automated planning ,improper utilization of resources, etc are associated with project failure are directly or indirectly related to project management.

In todays era, software firms has major problem of project failures due to schedule and cost overruns. To avoid this the software industries should be sensitized with using proper quality checks and automation using tools for estimation and project planning. Also project decisions should be taken after reviewing previous project experiences which should be recorded for future use.

Most of the industries use Know Error dB to save effort and time in resolving the same type of issues.
A software industry has different types of projects ,different relationship with the customers and different culture. Accordingly the project metrics should be defined to achieve success.


The perception of success depends on the role of the stakeholder(developer,manager,client,etc)

However below are the ten most important factors deciding projects success:-

1. Continuous Client feedback to developers
2. Skilled resources
3. Requirement reviewed and accepted by the development team
4. Continuous review and feedback from the project manager
5. Realistic project milestones
6. Structured and defined methodology
7. Project team involved in project decisions
8. Clear requirements
9. Clients support in case of requirement ambiguity
10. Good relationship and understanding b/w client and the project team

If you were asked as an expert to provide an estimate of the effort needed

Question: If you were asked as an expert to provide an estimate of the effort needed to make certain changes to an existing piece of software, what information would you like to have to hand to assist you in making that estimate?

Our teacher told us to get help from the internet but not to copy and paste. Our teacher told us to answer the questions briefly. This question very important for me. Please help me.

Lesson : Software Project Management. (Book: Software Project Management Bob Hughes and Mike Cotterell 5th edition)

Solution: Effort estimation for changes in a software project can be calculated using lines of code. But, before we estimate efforts, we need to estimate the size of the changes in terms of lines of code.

1. Using Function Points (Programming language independent)

We can count the number of functionalities that will be changed and then multiply that with the number of lines that will be needed to implement in a particular programming language (53 for Java)

2. Using Lines of Code directly (Programming language dependent)

Once we have the lines of code required for the changes, we can use one of the COCOMO models to estimate the efforts based on the number of lines of code.

There are 3 types of cocomo models for 3 types of different systems (based on size) and they have fixed values for the formula

Based on size of project

1. Organic

2. Semi-detached

3. Embedded

Based on degree of correctness or accuracy of estimation

1. Basic

2. Intermediate

3. Detailed (Break the software into modules and apply basic or intermediate cocomo)

Formula for Basic Cocomo

Software Projectsab
Organic2.41.05
Semi-detached3.01.12
Embedded3.61.20

Effort (E) = a * (LOC)b

Formula for Intermediate Cocomo

Software Projectsab
Organic3.21.05
Semi-detached3.01.12
Embedded2.81.20

Effort (E) = (a * (LOC)b )* EAF

Note: EAF stands for Effort adjustment factor and its value might usually be given in the question.