Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

<p>At this particular time, I am taking comp science part 2. I am currently stru

ID: 3638219 • Letter: #

Question

<p>At this particular time, I am taking comp science part 2. I am currently struggling piecing together the final stages of the prorgam listed below. It is asking me the "user" to show any and all employees, but<span><strong> not </strong></span>those that have the default id of -1(negative one). I am looking for assistance on how to adjust the compiled information to make it work without any errors once outputted. Any help is greatly needed and welcomed...</p>
<p>#include&lt;iostream&gt;<br />using namespace std;</p>
<p>class employee<br />{<br />private:</p>
<p>int id, maxHours;<br />float payRate;</p>
<p>public:</p>
<p>void setInfo (int pin, float pay, int hours)<br />{<br />id = pin;<br />payRate = pay;<br />maxHours = hours;<br />}</p>
<p>void viewInfo ()<br />// No parameters req.<br />{<br />cout&lt;&lt;"employee id: "&lt;&lt;id&lt;&lt;endl;<br />cout &lt;&lt;"employee pay rate: "&lt;&lt; payRate&lt;&lt;endl;<br />cout &lt;&lt;"employee max working hours"&lt;&lt;maxHours&lt;&lt;endl;</p>
<p>}</p>
<p>};</p>
<p>int main ( )<br />{</p>
<p>int pin, hours, record;<br />float pay;<br />int ch;<br />char ans;<br />employee empInfo[1000];<br />cout&lt;&lt;"1.ADD EMP 2.MODIFY EMP 3.DELETE EMP 4.EXIT";<br />cout&lt;&lt;"enter the choice: ";<br />cin&gt;&gt;ch;</p>
<p>switch(ch)<br />{</p>
<p>case 1:<br />cout &lt;&lt;"Enter employee 3 digit ID: ";<br />cin &gt;&gt; pin;<br />cout &lt;&lt;"Enter employee pay rate: ";<br />cin &gt;&gt; pay;<br />cout &lt;&lt;"Enter employee max hours: ";<br />cin &gt;&gt; hours;<br />empInfo[pin].setInfo(pin, pay, hours);<br />break;</p>
<p>case 2:<br />cout &lt;&lt;"Enter the employee ID# of the record you wish to modify ";<br />cin &gt;&gt; record;<br />empInfo[record].viewInfo();<br />break;</p>
<p>case 3:<br />cout &lt;&lt;"Enter the employee ID# of the record you wish to modify ";<br />cin &gt;&gt; record;<br />empInfo[pin].setInfo(0,0,0);<br />break;</p>
<p>case 4:<br />break;<br />}</p>
<p>return 0;</p>
<p>}</p>

Explanation / Answer

#include using namespace std; class employee { private: int id, maxHours; float payRate; public: void setInfo (int pin, float pay, int hours) { id = pin; payRate = pay; maxHours = hours; } void viewInfo () // No parameters req. { cout
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote