Preview

Pt1420 Unit 6 Programming

Satisfactory Essays
Open Document
Open Document
420 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Pt1420 Unit 6 Programming
John Bareswilt
Pt1420
Unit 6
Page 1
5.def mix colors ( primary1 , primary2 ) : i f primary1 == primary2 : return primary1 e l i f primary1 == ”red” and primary2 == ”blue” or primary1 ==
”blue” and primary2 == ”red ”: return ”purple” e l i f primary1 == ”red” and primary2 == ”yellow” or primary1
== ”yellow” and primary2 == ”red ”: return ”orange” e l i f primary1 == ”yellow” and primary2 == ”blue” or primary1
== ”blue” and primary2 == ”yellow ”: return ”green” global primary1 = input (” Please enter a primary color : ”) global primary2 = input (” Please enter another primary color : ”) i f global primary1 != ”red” and global primary1 != ”blue” and global primary1 != ”yellow” or global primary2 != ”red” and global primary2 != ”blue” and global primary2 != ”yellow ”: print (” These are not primary colors . I can ’ t mix them !”) else : secondary color = mix colors ( global primary1 , global primary2 ) print (”When you mix the primary colors , ” , global primary1 , ” and ” , global primary2 , ” , you get the secondary color ,
” , secondary color , ”.” , sep = ’ ’)
6. Public Class BookMain
Public Shared Sub Main
Dim numberOfBook As Integer = 5

Console.WriteLine("{0} Points", GetPointByPurchase(numberOfBook))
End Sub
End Class

Public Module Main
Public Function GetPointByPurchase(ByVal numberOfBook As Integer) As Integer
Select Case numberOfBook
Case 1
GetPointByPurchase = 5
Case 2
GetPointByPurchase = 15
Case 3
GetPointByPurchase = 30
Case >= 4
GetPointByPurchase = 60
Case Else
GetPointByPurchase = 0
End Select
End Function
End Module
7. Console.WriteLine("Enter the number of packages to be purchased.");

if (numberPurchased >= 10 && numberPurchased <= 19) {

discountPercentage = 20; }

else if (numberPurchased >= 20 && numberPurchased <= 49) {

discountPercentage = 30;

}

else if (numberPurchased >= 50 && numberPurchased <= 99) {

discountPercentage = 40;

}

You May Also Find These Documents Helpful

  • Satisfactory Essays

    Nt1310 Unit 4

    • 775 Words
    • 4 Pages

    Part III PHYSICS HSE II Time:2Hours Max:60 Scores 1. Three identical charges each +q are placed at the corners of an equilateral triangle of side d cm. Calculate the force on a +ive charge +2q at the centroid of the triangle. 2 2.If the earth is supposed to be a metallic sphere,its capacity will be nearly (a) 700pf (b) 700 microfarad (c) 700f (d) 6.4 X10^6 f 1score 3. write the relation between dielectric constant and electric susceptibility. 1score 4. A box encloses an electric dipole consisting of charge 5micro C and -5micro C and of length 10cm. What is the total electric flux through the box? 2scores 5. Find the ratio of the p.d that must be applied across the (1)parallel (2) series combination of two identical capacitors so that the energy stored in the two cases becomes the same. 2 scores 6.(a)…

    • 775 Words
    • 4 Pages
    Satisfactory Essays
  • Better Essays

    Mt435 Unit 3 Assignment

    • 1483 Words
    • 6 Pages

    Russell, R. Taylor, B. (2011). Operations Management: Creating Value along the Supply Chain, 7th Edition. Hoboken, New Jersey: John Wiley and Sons…

    • 1483 Words
    • 6 Pages
    Better Essays
  • Good Essays

    Nt1310 Unit 5

    • 368 Words
    • 2 Pages

    the ratio of resistors on one side of the bridge is one while the ratio of resistors on the other side is infinity…

    • 368 Words
    • 2 Pages
    Good Essays
  • Satisfactory Essays

    MT445 Unit 4

    • 523 Words
    • 3 Pages

    Please answer the following questions. Submit as a Microsoft Word® document to the Dropbox when completed.…

    • 523 Words
    • 3 Pages
    Satisfactory Essays
  • Better Essays

    Mt435 Unit 6 Assignment

    • 1155 Words
    • 5 Pages

    (03) Getting the plant up to code needs to be a short term goal, as they could be shut down since they are not up to US safety and environmental standards. The company cannot afford a shut down or huge fines for not being in compliance. The EPA offers many services that can help the company to get in compliance and to help the company stay in compliance also and the company needs to seek their help to ensure they are meeting the standards.…

    • 1155 Words
    • 5 Pages
    Better Essays
  • Satisfactory Essays

    Is3350 Unit 1 Assignment

    • 2098 Words
    • 9 Pages

    If a change in accounting policy is caused by the initial application of an international standard or…

    • 2098 Words
    • 9 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Pt1420 Unit 4

    • 4123 Words
    • 17 Pages

    A minimization problem with four decision variables, two greater-than-or-equal-to constraints, and one equality constraint will have…

    • 4123 Words
    • 17 Pages
    Satisfactory Essays
  • Good Essays

    Is3350 Unit 4 Assignment

    • 414 Words
    • 2 Pages

    IT projects are very different from other projects (like construction projects) in almost every aspect from initiating to releasing the project. Because these projects are mostly very diverse in term of cost, size and complexity. They often include a team having members of diverse knowledge, background and skills and the technologies involved are also diverse. A lot of technical teams are involved in developing something that may look acceptable for outsiders.…

    • 414 Words
    • 2 Pages
    Good Essays
  • Good Essays

    Nt1420 Unit 6

    • 1145 Words
    • 5 Pages

    INSTRUCTIONS: 1. THERE ARE SIX (6) QUESTIONS IN THIS PAPER. 2. ANSWER FIVE (5) QUESTIONS ONLY. Question 1 Arrays are used when storing a large number of values. You are required to create an array named a and answer the following questions regarding array manipulation. a. Write a method fillRandom(int[] a, int min, int max), fill the array a with a random integer value. (Note: Math.random() returns a double in the range of 0.0 and 1.0, therefore it is cast to an integer number, between the minimum and maximum value). [6 marks] b. Write the Bubble sort method to sort array a into descending order. [10 marks] c. In the quicksort, an algorithm an element is chosen from the unsorted list. This element is called the…

    • 1145 Words
    • 5 Pages
    Good Essays
  • Satisfactory Essays

    Pay attention to the suggested corrects details, because if you don’t you’ll not get it. I have no problem with the spelling of “Andrews”. Look at your post when you say address, you brought period(.) then (2014) immediately after Andrews, instead of comma (,). I don’t think is my job to be talking about this minute and infinitesimal detail.…

    • 64 Words
    • 1 Page
    Satisfactory Essays
  • Satisfactory Essays

    Nt1310 Unit 1 Module 2

    • 283 Words
    • 2 Pages

    On Thursday, December 22nd 2016, at approximately 10:00AM Mrs. Marie Ernst, HAAS Assistant Principal, informed me a HASD tablet computer, issued to Gilbert Reyes, Grade 10, was broken during period 1/2. She received information on Wednesday, December 21st, 2016 from Mr. Michael Shebolock, HAAS Physical Ed Teacher, regarding the broken tablet.…

    • 283 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Nt2460 Unit 1 Assignment

    • 762 Words
    • 4 Pages

    These addresses are commonly used for home, office, and enterprise local area networks (LANs), when globally routable addresses are not mandatory, or are not available for the intended network applications. Under IPv4, the private IP address spaces were originally defined in an effort to delay IPv4 address exhaustion, but they are also a feature of IPv6, the next generation Internet Protocol.…

    • 762 Words
    • 4 Pages
    Good Essays
  • Good Essays

    Nt1310 Unit 4

    • 1039 Words
    • 5 Pages

    Users feel alert and in tune with their surroundings. Sound, colour and emotions seem more intense. Users may dance for extended periods. Effects may last for 3 to 6 hours.…

    • 1039 Words
    • 5 Pages
    Good Essays
  • Powerful Essays

    4. Assume the variables result, w,x, y, and z are all integers, and that w= 5, x= 4, y=8 and z=2. What will the values be stored in result in each of the following statements?…

    • 748 Words
    • 3 Pages
    Powerful Essays
  • Satisfactory Essays

    Pt1420 Unit 6

    • 222 Words
    • 1 Page

    1. The society will consist of an agricultural branch, which will be responsible for gathering/growing food for the people. There will be a construction branch, which will be responsible for building houses, public buildings and other structure and repairing them if needed.…

    • 222 Words
    • 1 Page
    Satisfactory Essays

Related Topics