Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

JordanUniversityofScienceandTechnology ComputerScienceDepartment/Secondsemester2010/2011 CS115C++ProgrammingLanguage/Sections1,12,and13

Assignment#1
Preparedby:Eng.MohammedI.AlHammouri

DueDate:Wednesday9/3/2011
Objective:
1. UnderstandhowtowriteaC++program 2. Understandhowtousearithmeticoperators 3. Understandhowtousecinstatements 4. Understandhowtousecoutstatements 5. Understandhowtouseacommentsandadescriptivevariablenames

Questions: Q1)WriteaC++programthatreadstworesistorsR1andR2connectedinparallelandthenfind theequivalentresistance.

Req =

1 1 1 + R1 R2

Q2)Acomplexnumberisanexpressionoftheform Whereaistherealpartandbistheimaginarypartofthecomplex,andiis 1 .Forexample, 3.5+2iisacomplexnumber.3.5isrealpart,and2istheimaginarypart. **WriteaC++programtoread2complexnumbersandthenmultiplythetwocomplex numbers. Themultiplicationoftwocomplexnumbersisdefinedbythefollowingformula:

Yourprogrampromptstheusertoentera,bofthefirstnumber,andc,dofthesecondnumber,and

thenprintthevalueofthemultiplication.
Page1of4

JordanUniversityofScienceandTechnology ComputerScienceDepartment/Secondsemester2010/2011 CS115C++ProgrammingLanguage/Sections1,12,and13

Assignment#1
Preparedby:Eng.MohammedI.AlHammouri

DueDate:Wednesday9/3/2011 Generalnotes:
1. Thisassignmentshouldbedonebyeachindividualnogroups. 2. Submittheassignmentusingtheelearningsystem;dontusetheemailsystemtosend yourassignment.Duedate:Wednesday9/3/2011,nolatesubmissionwillbeallowed. 3. Submitonlyworkingcode(cppfile). 4.

Cheating(wewillgetZEROmark)

Q1)(Testing) Test1:

Test2:

Page2of4

JordanUniversityofScienceandTechnology ComputerScienceDepartment/Secondsemester2010/2011 CS115C++ProgrammingLanguage/Sections1,12,and13

Assignment#1
Preparedby:Eng.MohammedI.AlHammouri

DueDate:Wednesday9/3/2011
Q2(Testing): Test1:

Test2:


Page3of4

JordanUniversityofScienceandTechnology ComputerScienceDepartment/Secondsemester2010/2011 CS115C++ProgrammingLanguage/Sections1,12,and13

Assignment#1
Preparedby:Eng.MohammedI.AlHammouri

DueDate:Wednesday9/3/2011

CorrectionSheet:

Student Notes Mark


Documentationand coding

Useadescriptivevariablenames WriteaComments Writeapromptstatements

2 1 1 1.5 1.5 1.5 1.5

Testing

Q1Test1 Q1Test2 Q2Test1 Q2Test2

Total/10

10

Page4of4

You might also like