Friday, May 8, 2015

CB Citizenship Project - Community Program

Community Program



Nama : Alvin Theodora
NIM  : 1801428434

Isi Laporan :
After a week had passed, we went back again to Yummy Yummy restaurant, and introduce them about social media that I and my partner have created.
Just like Ayam Bakar Cirebon before, we have created Twitter and Instagram for Madam Anisa. People can find Yummy Yummy on twitter @YummyYummy and also on instagram with the same username.
We are also explaining to them what is social media and how to use them. Madam Anisa  seems to be confused at first, but we try to introduce them and get them to know it for promoting the restaurant.

Friday, May 1, 2015

CB Citizenship Project - Community Program

Community Program



Nama : Alvin Theodora
NIM  : 1801428434

Isi Laporan : 
After Ayam Bakar Cirebon Pak Kumis, we selected our next candidate which is called Yummy Yummy. Madam Anisa is the owner of this restaurant, we ordered Capucino Cincau because it looks great. The taste of that particular drink is very refreshing and also quite cheap.
Madam Anisa also agreed to help us with our CB project, so we conducted a short interview with her and here’s the result that we got
-She had been opening Yummy Yummy about 7 months
-Yummy Yummy opens at 7am and closes at 7pm
-She could get around 600 thousand rupiah each day
-Madam Anisa never had a social media before and never had a special promotion for her business
And we have decided to help Madam Anisa to promote her marginal restaurant through social media.



Monday, April 27, 2015

CB Citizenship Project - Community Program

Community Program



Nama : Alvin Theodora
NIM  : 1801428434

Isi Laporan : 


After we visited to Ayam Bakar Cirebon last week, we came back to the place again for the second time in the next week.
Between that week, I and my partner are discussing and making social media for the restaurant. We are going to help them to promote their products from the social media itself. And we have decided to create 2 different kinds of social media, the first social media is Twitter(@KumisAyam). We’ve chosen twitter for our first social media because it is simple to use even for new people and also most of the Indonesian people are using twitter.
Second, the social media we are using is Instagram(@KumisAyam), we have chosen instagram as our second media because it shares pictures so, people can know what they are selling and of course many Indonesian people are still using this social media.
After making the social media, we explain to them what is social media and how does it work. They are a little bit confused on how to use it at first, but we try to explain and maintain it for promoting the restaurant.


Monday, April 20, 2015

CB Citizenship Project - Community Program


Community Program




Nama         : Alvin Theodora
NIM            : 1801428434

Isi Laporan :

Since our project goal is to promote small and marginal food store to public, we decided to go to "Ayam Bakar Cirebon Pak Kumis" restaurant, a marginal grilled chicken restaurant located at Alam Sutera. We came there and ordered two sets of grilled chicken and rice, and as what we expected, the taste is delicious, and is definitely worth to try. The price is also friendly for student like us. The owner of this restaurant is Pak Darmadi, he has been opening this restaurant for almost 9 years, and has one branch located behind Living World Mall. He can sell up to 40 chickens in a day with revenue 2 million rupiahs. This restaurant opens from 10 a.m and closes at 8 p.m.

Due to lack of information of social media, Pak Darmadi never promotes his restaurant in social media, and we have decided to help Pak Darmadi to make him one and promotes his business.




Saturday, March 21, 2015

Run For Leprosy 2015 - Alvin Theodora 1801428434

Nama : Alvin Theodora
NIM   : 1801428434

Pada tanggal 15 Maret lalu, kami melakukan sebuah charity event untuk saudara-saudara kita yang terkena penyakit kusta / pernah terkena penyakit kusta yang diselenggarakan oleh BINUS University.

Kesan saya setelah mengikuti acara tersebut adalah saya sangat terkesan atas kepedulian orang - orang di sekitar saya karena mereka perduli terhadap sesama dan mau membantu sesama yang sedang kesusahan atau membutuhkan bantuan.

Pesan saya juga terhadap semua panitia dan peserta pada event tersebut, semoga apa yang sudah kita lakukan dapat direalisasikan dan ditargetkan kepada orang-orang yang memang membutuhkan pertolongan, dan juga semoga charity event seperti ini dapat terus dilakukan karena ini merupakan tindakan yang positif bagi diri sendiri maupun untuk orang lain.

Penyakit kusta merupakan penyakit yang disebabkan oleh bakteri dan dalam jangka waktu yang lama, dapat merusak sistem saraf, kulit, anggota gerak, maupun mata. Namun, penyakit kusta dapat dicegah dengan cara mengetahui gejala-gejalanya, oleh karena itu sosialisasi yang baik dari berbagai pihak pun perlu diterapkan agar masyarakat mengetahui betul tentang gejala-gejala dari penyakit kusta, sehingga penyakit ini dapat dicegah penyebarannya.

Event Run For Leprosy ini pun dapat membantu saudara-saudara kita yang memang membutuhkan pertolongan, dan semoga charity event ini dapat digunakan sebaik-baiknya untuk pengobatan, penyuluhan, dan cara-cara lainnya untuk menolong sesama kita.

Monday, January 5, 2015

Assignment 9 Programming Language Concepts

Name : Alvin Theodora
NIM   : 1801428434

Here is the ninth assignment of Programming Language Concepts course. The question is taken from "Concepts of Programming Language, 10th edition" from Robert W. Sebesta in chapter 9:

Review Questions

1. What are the three general characteristics of subprograms?
=  
- Each subprogram has a single entry point.
- The calling program unit is suspended during the execution of the called subprogram, which implies that there is only subprogram in execution at any given time.
- Control always returns to the caller when the subprogram execution terminates.

2. What does it mean for a subprogram to be active?
. It means that after having been called, a subprogram has begun execution but has not yet completed that execution.

3. What is given in the header of a subprogram.
=  subprogram header, which is the first part of the definition, serves several purposes. First, it specifies that the following syntactic unit is a subprogram definition of some particular kind.1 In languages that have more than one kind of subprogram, the kind of the subprogram is usually specified with a special word. Second, if the subprogram is not anonymous, the header provides a name for the subprogram. Third, it may optionally specify a list of parameters.

 4. What characteristic of Python subprograms sets them apart from those of other languages?
One characteristic of Python functions that sets them apart from the functions of other common programming languages is that function def statements are executable. When a def statement is executed, it assigns the given name to the given function body. Until a function’s def has been executed, the function cannot be called.
Consider the following skeletal example:if . . .
def fun(. . .):
. . .
else
def fun(. . .):
. . .

5. What languages allow a variable number of parameters ?
C,C++,Perl JavaScript, and Lua. Also, C# allows methods to accept a variable number of parameters, as long as they are of the same type.


Problem Set

1. What are arguments for and against a user program building additional definitions for existing operators, as can be done in Python and C++? Do you think such user-defined operator overloading is good or bad? Support your answer.
=  FOR:
It allows the developer to program using notation “closer to the target domain” and allows user-defined types a similar level of syntactic support as types built into the language. It can easily be emulated using function calls.

AGAINST:
It can be implemented according to user’s want, eventhough it is not logically true.

I think such user-defined operator overloading is good as long as user use it according to its logical rules. User must use for example, + operator to be overloaded to implement “add” not “substraction”. And sometimes, in C++ there is condition when user need to add many data in class, so user-defined operator like this is needed to make it easier.

2. . In most Fortran IV implementations, parameters were passed by reference, using access path transmission only. State both the advantages and disadvantages of this design choice.
The main advantage of this method is the fast accesses to formal parameters in subprograms. The disadvantages are that recursion is rarely useful when values cannot be passed, and also that a number of problems, such as aliasing, occur with the method.

3. . Argue in support of the Ada 83 designers’ decision to allow the implementor to choose between implementing in out mode parameters by copy or by reference.
The tradeoff is one of efficiency of passing parameters vs. efficiency of accessing the parameters in the subprogram. Ada leaves this choice to the implementor, rather than forcing a single solution, because different situations may require different approaches. Passing a large array which the subprogram only accesses a few times is faster with reference. Passing any argument that the subprogram accesses a lot is faster with copy.

4. Suppose you want to write a method that prints a heading on a new output page, along with a page number that is 1 in the first activation and that increases by 1 with each subsequent activation. Can this be done without parameters and without reference to nonlocal variables in Java? Can it be done in C#?
This can be done in both Java and C#, using a static (or class) data member for the page number.

5. Consider the following program written in C syntax:
void swap(int a, int b) {
int temp;
temp = a;
a = b;
b = temp;
}

void main() {
int value = 2, list[5] = {1, 3, 5, 7, 9};
swap(value, list[0]);
swap(list[0], list[1]);
swap(value, list[value]);
}

For each of the following parameter-passing methods, what are all of the values of the variables value and list after each of the three calls to swap?
a. Passed by value
b. Passed by reference
c. Passed by value-result

 a. Passed by value
-value =1 , list[5] = {2,4,6,8,10}
b. Passed by reference
-value =6, list[5] ={4,1,2,8,10}
c. Passed by value-result
-value =6, list[5] ={4,1,2,8,10}











Monday, December 15, 2014

Assignment 8 Programming Language Concepts

Name : Alvin Theodora
NIM   : 1801428434

Here is the eighth assignment of Programming Language Concepts course. The question is taken from "Concepts of Programming Language, 10th edition" from Robert W. Sebesta in chapter 8:

Review Questions

1.   What is the definition of control structure?
 = A control structure is a control statement and the collection of statements whose execution it controls.

2. What did Bohm and Jocopini prove about flowcharts?
= It was proven that all algorithms that can be expressed by flowcharts can be coded in a programming languages with only two control statements: one for choosing between two control flow paths and one for logically controlled iterations.

3. What is the definition of block?
= In Ruby, block is a sequence of code, delimited by either breves or the do and and reserved words.
4. What is/are the design issue(s) for all selection and iteration control statements?
Selection
Two-way :

  • What is the form and type of the expression that controls the selection ?
  • How are the then and else clauses specified ?
  • How should the meaning of nested selectors be specified ?
Multiple-Selection :

  • On which type the selector is based ?
Iteration :

  • How is the iteration controlled ?
  • Where should the control mechanism appear in loop statement?

5. what are the design issues for selection structures?
  • What is the form and type of the expression that controls the selection ?
  • How are the then and else clauses specified ?
  • How should the meaning of nested selectors be specified ?


Problem Set


1. Describe three situation where a combined counting and logical looping statement is needed.
= A list of values is to be added to a SUM, but the loop is to be exited if SUM exceeds some prescribed value.
A list of values is to be read into an array, where the reading is to terminate when either a prescribed number of values have been read or some special value is found in the list.
The values stored in a linked list are to be moved to an array, where values are to be moved until the end of the linked list is found or the array is filled, whichever comes first.

2. Study the iterator feature of CLU in Liskov et al. (1981) and determine its advantages and disadvantages
= The key addition was the concept of a cluster, CLU’s type extension system and the root of the language’s name CLUster. Clusters correspond generally to the concept of an “object” in an OO language, and have roughly the same syntax.
CLU did not offer any sort of structure for the clusters themselves. Cluster names are global, and no namespace mechanism was provided to group clusters or allow them to be created “locally” inside other clusters. This problem is not unique to CLU, but it is surprising that so many languages have lacked this feature — given the centralness in ALGOL of giving scope to variables, it seems that giving scope to cluster/object names would be an obvious extension.
CLU does not perform implicit type conversions. In a cluster, the explicit type conversions ‘up’ and ‘down’ change between the abstract type and the representation. There is a universal type ‘any’, and a procedure force[] to check that an object is a certain type.
Another key feature of the CLU type system are iterators, which return objects from a collection one after the other. Iterators were “black boxes” that offered an identical API no matter what data they were being used with. Thus the iterator for a collection of complex_numbers would be identical to that for an array of integers.
CLU also includes exception handling, based on various attempts in other languages; exceptions are raised using signal and handled with except. Oddly, given the focus on type design, CLU does not offer enumerated types, nor any obvious way to create them.
A final distinctive feature in CLU is multiple assignment, where more than one variable can appear on the left hand side of an assignment operator

3. Compare the set of Ada control statements with those of C# and decide which are better and why.
= C# because the C# multiple selection structures is a great boost to C# writability, with no obvious negatives, furthermore C# control statement is the most flexible iteration statement.

4. What are the pros and cons of using unique closing reserved words on compound statements?
= Unique closing keywords on compound statements have the advantage of readability and the disadvantage of complicating the language by increasing the number of keywords.

5. What are the arguments, pro and con, for Python’s use of indentation to specify compound statements in control statements?
=
Pros of indentation:
  • Helps reduce inconsistent indentation in code which makes it easier to read (in other words consistency)
  • clears the screen by replace visible tokens with whitespace to serve the same purpose

Cons of indentation
  • Much easier to cut and paste code to different levels (you don’t have to fix the indentation)
  • More consistent. Some text editors display whitespace(s) differently.
  • You cannot safely mix tabs and spaces in Python such that it would be easy to cause an error by putting too few spaces in an indentation level, thus going to the previous indentation level and closing the loop/block. This decreases writability.