Preview

Variable and Meal Price

Satisfactory Essays
Open Document
Open Document
1236 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Variable and Meal Price
PT1420 - Unit 4 Homework and Lab Assignment

Unit 4 Assignment 1: Homework (from Chapter 3)

True and False (bold your answer)
1.) Modules make it easier for programmers to work in teams
True
2.) Calling a module and defining a module mean the same thing.
True
3.) A statement on one module can access a local variable in another module. False
4.) Programming languages typically require that arguments be of the same data type as the parameters that they are passed to.

True
5.) When an argument is passed by reference, the module can modify the argument in the calling part of the program.

True
6.) Passing an argument by value is a means of establishing two-way communication between modules.

false
8.) What will this program code display?
Module main()
Dim x as integer = 1
Dim y as double = 3.4
Console.Writeline(x & “ “ $ y) changeUs(x, y)
Console.Writeline(x & “ “ $ y)
End module
Sub changeUs(ByVal x as integer, ByVal y as double) a = 0 b = 0
Console.Writeline(x & “ “ $ y)
End Sub

1 and 3.4
0 and 0

9.) What will this program code display?
Module main()
Dim x as integer = 1
Dim y as double = 3.4
Console.Writeline(x & “ “ $ y) changeUs(x, y)
Console.Writeline(x & “ “ $ y)
End module
Sub changeUs(ByRef x as integer, ByRef y as double) a = 0 b = 0
Console.Writeline(x & “ “ $ y)
End Sub

This would be 1 and 3.4

10.) Design a subroutine called timesTen. The subroutine should accept an integer argument. When the subroutine is called, it should display the product of its argument multiplied by 10.

Module Module1

Sub Main() Dim number As Integer

Console.WriteLine("Please type a number") number = Console.ReadLine()

TenTimes(number)

End Sub

Sub TenTimes(ByVal number As Integer) Number = number * 10 Console.writeline("The product of number is: " & number) End

You May Also Find These Documents Helpful

  • Satisfactory Essays

    a. The time in hours, minutes, and seconds is to be passed to a function named totsec().…

    • 720 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    6. What is the difference between passing an argument by value and passing it by reference?…

    • 765 Words
    • 5 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Please have the patient fill out a small trifold paper named “Alternate Meal Request” for either lunch or dinner option for that day. Some assistance may be required.…

    • 94 Words
    • 1 Page
    Satisfactory Essays
  • Satisfactory Essays

    input the name and price of an item and its weight in pounds and ounces.…

    • 269 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Unit 4 Homework

    • 401 Words
    • 2 Pages

    What is the difference between passing an argument by value and passing it by reference? By Value means that only a copy of the argument’s value is passed into the parameter variable. Passing by Reference means that the argument is passed into a special type of parameter.…

    • 401 Words
    • 2 Pages
    Satisfactory Essays
  • Better Essays

    6) When you pass by value you pass a copy. When you pass by reference, you can modify the contents.…

    • 1580 Words
    • 11 Pages
    Better Essays
  • Satisfactory Essays

    | Use this information for questions that refer to the World Tennis Ball (WTB) Company case.…

    • 23982 Words
    • 96 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Positional Notation: Quiz

    • 518 Words
    • 4 Pages

    times. Finally, and that is what we have to use here to find any decimal number (Michal does not specify…

    • 518 Words
    • 4 Pages
    Satisfactory Essays
  • Good Essays

    it320 assignment 1-3

    • 1779 Words
    • 8 Pages

    5. This chapter describes the concepts behind how a CPU reads the contents from RAM. Which of the following is true about the process of read data, as described in the chapter? (A. the CPU tells the RAM which address holds the data that the CPU wants to read.)…

    • 1779 Words
    • 8 Pages
    Good Essays
  • Satisfactory Essays

    1. In question 1, I have assumed its only the Tashtego that makes the trip of Balik to Singapore and back. I have also assumed the relevant cost is the cargo cost only. Therefore, profit contribution of carrying I ton of tapioca from Balik and Singapore:…

    • 606 Words
    • 3 Pages
    Satisfactory Essays
  • Good Essays

    Fluids

    • 2539 Words
    • 11 Pages

    1. Identify each of the following statements as either true or false. If false, explain why.…

    • 2539 Words
    • 11 Pages
    Good Essays
  • Good Essays

    Cost Of Food Essay

    • 591 Words
    • 3 Pages

    Cost of food is seen as an issue when it comes to eating healthier and more sustainably. Organic produce isn’t always priced fairly and vegan alternatives can add up in price as well. Since we each have personal budgets shopping for food can be a limiting experience. For this reason we each develop eating habits that are most convenient to us. When these eating habits make us sick, we suffer by keeping them instead of changing them. We can start with farmers markets which are growing organizations in communities. More have been made available to smaller suburban cities because farmers are aware of the demand of quality food we have too. Many farmers markets also accept government aid in form of EBT or food stamps. If a market hasn’t already began this practice, you can…

    • 591 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    Recognized Arguments

    • 1563 Words
    • 7 Pages

    In this assignment, you will apply key concepts covered in the module readings. You will identify the component parts of arguments and differentiate between various types of arguments such as strict, loose, inductive, and deductive. You will then construct specific, original arguments.…

    • 1563 Words
    • 7 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Variable Costs

    • 768 Words
    • 4 Pages

    The management of costs is a very important aspect of managing financial resources. If costs are not managed effectively, it can lead to profits being damaged and the business potentially unable today its expense. Keeping within a budget, increasing income in order to cope with change and making sure that working capital is available and money and set aside for emergencies is all part of the balancing exercise.…

    • 768 Words
    • 4 Pages
    Satisfactory Essays
  • Better Essays

    Asked for their reactions to specific demand-shifting tactics based on revenue management, patrons of a restaurant in Ithaca, New York, indicated that they generally would be willing to shift their dining time to off-peak hours in exchange for discounts on menu items. Better than three-quarters of the 367 respondents agreed that they would accept an incentive for dining at an off-peak time. Specific results and conclusions are detailed below. Keywords: revenue management; pricing strategies As airlines and hotels continue to build and refine successful revenue- management strategies, restaurants have recently realized the value that revenue-management planning can bring to the bottom line.…

    • 7209 Words
    • 29 Pages
    Better Essays