当前位置:天才代写 > 作业代写,留学生作业代写-北美、澳洲、英国等靠谱代写 > 编程原理(一)代写 USB drive代写

编程原理(一)代写 USB drive代写

2021-09-03 15:27 星期五 所属: 作业代写,留学生作业代写-北美、澳洲、英国等靠谱代写 浏览:399

编程原理(一)代写

2807/7001ICT Programming Principles (I)

Workshop 10

School of Information and Communication Technology

编程原理(一)代写 1 Preparation Before your workshop class: Read all of this document. Review the lecture notes sections 1 to 25.

 

1 Preparation  编程原理(一)代写

Before your workshop class:

  • Read all of this document.
  • Review the lecture notes sections 1 to 25.
  • Bring some paper (a print-out of this document is best) and writing implements.
  • Bring a storage device, such as a portable hard drive and cable, or a USB drive.

 

2 Pre-workshop questions

There are no pre-workshop questions for this workshop.

 

3 Workshop activities  编程原理(一)代写

3.1 Class design

Case study: A Go Card account maintains a balance that may be spent on public transport. Users may request a statement that shows all transactions. The only transactions are to top up the account with some positive number of dollars, and to take a ride costing some dollars and cents.

The goal for this exercise is to develop a class for a Go Card Account. The class will be tested by a program that simulates transactions, like this:

Creating account. Input initial balance: 100
? r 3.50
? r 10.90
? b
Balance = $85.60
? t 20
? x gghhg 
Bad command.
? t
Bad command.
? q
1Statement:
event       amount ($)        balance ($)
Initial balance                 100.00
Ride         3.50               96.50
Ride         10.90              85.60
Top up       20.00              105.60
Final balance                   105.60

Where:

  • number simulates a ride costing number dollars;
  • number simulates a top up of number dollars;
  • b requests the currrent balance; and
  • q ends input and prints a statement.

Bad inputs are to be reported and ignored.

Let us consider the design for a class that represents a Go Card account. To design a class, we consider what services the object(s) must provide (its methods), and what data needs to be stored in the object(s) to support those services.

 

编程原理(一)代写
编程原理(一)代写

 

Questions:
  • What is a good name for a class that represents a Go Card account?

Be descriptive of the what the class represents. Don’t include the word “class” in the name.

  • What services should be provided?

A constructor (_ _init_ _) is required to set up the account with an initial balance.

It needs to record the amount each ride costs. A method that accepts the amount as a parameter is required.

It needs to record the amount for each top-up. A method that accepts the amount as a parameter is required.

It needs to be able to report the current balance at any time. A method that returns this is required.

– A method is required print out a statement of all of the transactions.

We can see from the output of the proposed program that the class needs to store the details of every transaction in order. It also needs to

  • What data is required to be stored in the object to enable those services?

So that a method can return the current balance at any time, it would be useful have a fifield for the current balance.

So that the full statement can be printed, the object must store the amount of each transaction, in order. What data type can grow and keep multiple values in the order they are added?

3.2 Problem 1 (3 marks)

Problem: Implement the program descibed above, leaving out the printing of a full statement at the end.

3.3 Problem 2 (2 marks)

Problem: Implement the program descibed above, including the printing of a full statement at the end.

 

4 After the workshop  编程原理(一)代写

  • You have created programs that might be useful to refer back to in future workshops. Make sure that you will have that work in the future. One copy is not enough for at IT professional. You should have at least 2 copies:

1.on your Griffiffiffith network storage drive; and

2.on your portable storage device.

  • Please answer these feedback questions.

What was the best aspect of this workshop?

What was the most diffiffifficult or worst aspect of this workshop?

Did you fifind an error in these workshop notes?

 

编程原理(一)代写
编程原理(一)代写

 

其他代写: program代写 project代写 essay作业代写 作业代写 作业加急 英国代写 北美作业代写 homework代写 java代写 matlab代写 finance代写 python代写 report代写 paper代写 assignment代写 加拿大代写

合作平台:essay代写 论文代写 写手招聘 英国留学生代写

 

 

天才代写-代写联系方式