unit 3

Satisfactory Essays
Short Answer 5. What two things must you normally specify in a variable declaration?
You must specify the variable type and an identifier. int n; // type - int, identifier - n 6. What value is stored in uninitialized variables?
Some languages assign a default value as 0 to uninitialized variables. In many languages, however, uninitialized variables hold unpredictable values.
Algorithm Workbench
3. Write assignment statements that perform the following operations with the variables a, b, and c.
Adds 2 to a and stores the result in b.
Multiplies b times 4 and stores the result in a
Divides a by 3.14 and stores the result in b
Subtract 8 from b and stores the result in a
4. Assume the variables result, w, x, y , and z are integers, and that w=5, x=4, y=8, and z=2. What value will be stored in result in each of the following statements?
Set result = x + y
Set result = z* 2
Set result = y / x
Set result = y – z
5. Write a pseudocode statement that declares the variable cost so it can hold real number.
6. Write a pseudocode statement that declares the variable total so it can hold real integers. Initialize the variable with the value 0.
7. Write a pseudocode statement that assigns the value of 27 to the variable count.
8. Write a pseudocode statement that assigns the sum of 10 and 14 to the variable total.
9. Write a pseudocode statement that subtracts the variable Down Payment from the variable total and assigns the result to the variable due.
10. Write a pseudocode statement that multiplies the variable subtotal by 0.15 and assigns the result to the variable total fee.

Programming Exercises

6. Sales Tax 8. Tip, Tax, and Total
Design a program that calculates the total amount of meal purchased at a restaurant. The program should ask the user to enter the charge for the food, and then calculate the amount of a 15% tip and 7% sales tax. Display each of these amounts and the total.

You May Also Find These Documents Helpful

  • Good Essays

    Unit 3

    • 758 Words
    • 4 Pages

    unit Unit 3 P4- Explain possible priorities and responses when dealing with two particular incidents or emergencies in a health and social care setting There are many incidents and emergencies that can occur in a health and social care setting regardless of how careful you try and it is how many precautions they take. The health care setting I will be talking about is a Care home, and the priorities and responses that should take place when dealing with incidents and emergencies within it. Priorities…

    • 758 Words
    • 4 Pages
    Good Essays
  • Powerful Essays

    Unit 3

    • 4465 Words
    • 18 Pages

    | | | | |P1:describe how marketing techniques are used |M1:compare marketing techniques used in |D1: evaluate the effectiveness of the use of | |to market products in two organizations |marketing products in two organizations |techniques used in marketing products in one | | |…

    • 4465 Words
    • 18 Pages
    Powerful Essays
  • Satisfactory Essays

    unit 3

    • 1472 Words
    • 6 Pages

    Has lost electrons; indicated by a positive sign, as in Na+ 2 : Molecule that dissociates in water to form individual ions, ionic compound 3 : Substances whose molecules have more than one kind of atom 4 : Positively charged particle in nucleus 5 : Function is to store energy for later use M. 6 : Alkaline 7 : Double sugar made up of two monosaccharide units 8 : A group of atoms bound together in a group 9 : Non-charged particle in nucleus 10 : Chemical systems that absorb excess acids or bases…

    • 1472 Words
    • 6 Pages
    Satisfactory Essays
  • Better Essays

    Unit 3

    • 4584 Words
    • 15 Pages

    Unit 3 Wider Professional Practice 1. Understand the concept of professionalism and core professional values in the lifelong learning sector 1.1 Analyse key aspects of professionalism in the lifelong sector . Define professionalism min 2 definition and compare them Webster’s Dictionary defines professionalism as the conduct, aims or qualities that characterize or mark a professional person (1). Meanwhile Oxford dictionary defines it as the practising of an activity, especially a sport, by professional…

    • 4584 Words
    • 15 Pages
    Better Essays
  • Good Essays

    Unit 3

    • 2650 Words
    • 31 Pages

    reference Then, go to www.vision2learn.com and send your completed Assessment to your tutor via your My Study area – make sure it is clearly marked with your name, the course title and the Unit and Assessment number. Name: Daniel Booth Please note that this Assessment document has 14 pages and is made up of 3 Parts. Part 1: Understand food labelling 1. Identify the nutritional information that must be provided on food labels. On food labelling nutritional information must be showing…

    • 2650 Words
    • 31 Pages
    Good Essays
  • Good Essays

    UNIT 3

    • 958 Words
    • 4 Pages

    UNIT 3 1.1 Explain what is meant by diversity, equality and inclusion. Diversity; this is the difference in people’s culture, color, race, background, moral believes and religion. In other for diversity to be effective, people need to accept others for who they are in the society such as people who do not share the same values. In health care, the diversity range from elderly, mental health, disabilities and race. Care assistants meet different types of people from different background during…

    • 958 Words
    • 4 Pages
    Good Essays
  • Powerful Essays

    Unit 3

    • 2023 Words
    • 9 Pages

    Unit 3 Supporting children E1 - current laws that influence working practices in a setting for children are -United Nations Convention on the Rights of the Child 1989/1991 , Children Act 1989 , Children Act 2004 , Equality Act 2006 , speacial educational needs and disability act 2001. E2 - Uncrc legislation influence working practices in the setting by giving children their own special rights and allows childrens views to be heard.it defends the familys role in childrens lives , respects children…

    • 2023 Words
    • 9 Pages
    Powerful Essays
  • Good Essays

    Unit 3

    • 2740 Words
    • 11 Pages

    Sarah Brindley, Unit 3 - suppporting children. E1/E2- Five pieces of current legislation are, Children Act 2004, Human Rights Act 2000, UNCRC 1998, Equality Act 2006 and Protection of data act 1999. Children Act 2004 states that the interests of children and young people are better in all considerations of welfare and safeguarding and that safeguarding children is everyone's responsibility. This is because safegaurding can only be achieved by building up a range of outcomes for children and…

    • 2740 Words
    • 11 Pages
    Good Essays
  • Good Essays

    Unit 3

    • 680 Words
    • 3 Pages

    controls of a trusted website and injects malicious code with the intent of spreading it to other end users. For example, an attacker injects a browser script on a website, so that other users will click on it and compromise sensitive information. 3. What is a reflective cross-site scripting attack? A reflective cross-site scripting attack is when the injected script is reflected off the web server, much like an error message or search results. This type of attack is mostly carried out by e-mail…

    • 680 Words
    • 3 Pages
    Good Essays
  • Good Essays

    Unit 3

    • 924 Words
    • 5 Pages

    Chapter 8 1. Define the term empowerment, being sure to distinguish between involvement and empowerment. Involved employees are asked for their input, but are not given ownership of their jobs. Empowered employees are given ownership of the process and they are responsible for the products or services generated by those processes. 10. What is a quality circle? A quality circle is a group of employees that meets regularly for the purpose of identifying, recommending, and making workplace improvements…

    • 924 Words
    • 5 Pages
    Good Essays