Pages

Tampilkan postingan dengan label uad. Tampilkan semua postingan
Tampilkan postingan dengan label uad. Tampilkan semua postingan

Jumat, 05 April 2013

refleksi minggu ke 5

alhamdulillah
minggu kelima Quiz pertama, dag dig dug
tapi bikin penasaran.. waktu 15 menit berjalan mengerjakan quissdengan lancarr
semoga dapett nilaiii
amiiiiiinnnn 
semangatt teman teman


raptor nama bulan

raptor bilangan berpangkat

raptor matrix berordo 2 >< 2

refleksi minggu ke-4

huaaaaaaaaaaa.......!!!! semua hancur berantakan diminggu keempat... banyak pikiran, tugas terbengkalai.. sampai" kelompok harus membeli tugas pada kelompok lain.. semoga tidak terjadi lagi diminggu" berikut nya.. tetap semangatt teman" kalian terhebatttt

refleksi minggu ke-3

ehmmmm.... minggu ketiga penuh dengan semangattt
tugas terselesaikan sebelum waktu tiba, bangun pagi., kuliah lancar, semua terasa "sempurna".
ternyata terdepan itu menyenangkan. kerja kelompok yang hebatt. makasih teman". semangat buat kita semuaaaaa..........

Jumat, 22 Maret 2013

refleksi minggu ke-2

Dateng lagi dehhh sabtu 16 maret 2013.huuuuuuuaaaaaaaaa KESIANGAN (semalem tidur jam 3 nyelesaiin tugas minggu lalu), kuliah jam 7 teng dan aku jam ¹/² tujuhh baru bangunn.. Gubrakkkkk Glodakkkk glodakkkk mandi, dandan, dll dipaket hemat Cuma 10 menit. Saat nya beraksi dengan “kang mas” sebutan kepada motor Honda kesayangan, tercinta, terbaik, tersetia, termengerti aku, dan ter ter ter lainnya. Meluncurrrrrrrrrrr tapi gak pake noss 5 menit sampe parkiran,dengan tenaga ekstra lari naik tangga, geal geol ngos ngosan sampe kelas. Huuuuu tarik napas, hembuskan, tarik napas, hembuskan… haaaaa baru deh bernafas lagii dan berkata “Alhamdullillah gak telat”. Gak lama Bapakke dateng, Teng teng,, dimulai deh pelajaran minggu kedua. Dan dan ternyata lebih lebih lebih mengejutkan lagi, kita dituntun untuk ngerjain tugas perkelompok dan kita dituntut untuk kerja tanpa ada yang nganggur satu pun. Selesaiiii pulang bawa bekal tugas lagii, dan belajar dari pengalaman minggu lalu gak mau lagi ahh ngerjainn tugas nunggu hari –H, kapok Lombok aku .Dan saatnya kita menanti pertemuan minggu ketiga dengan harap harap cemas (h²C ).

tugas alpro -3


Counting
Problem
Given a set of nstudent’s examination marks (in the range 0 to 100) make a count of the number of students that passed the examination. A pass is awarded for all marks of 50 and above.

Algorithm description
1.      Prompt then read the number of marks to be processed
2.      Initialize count to zero.
3.      While there are still marks to be processed repeatedly do
(a)   Read next mark.
(b)   If it is a pass (i.e.≥50)then add one to count.
4.      Write out total number of passes.

Pascal implementation
Program passacount (input, output);
Conts passmark=50;
Var count {contains number of passes on terminitation},
    i {current number of marks processed},
   m {current mark},
   n {total number of marks to be processed}: integer;
begin {count the number of passed (>=50) in a set of marks}
   writeln (‘enter a number of marks n on a separate line followed by the  marks’);
  readln (n);
  assert : n >=0}
count := 0;
i := 0;
{invariant: count = number of marks in the first I read that are >= passmark á´§ i=<n}
While i<n do
Begin {read next mark, test it for pass and update count if necessary}
i := i + 1;
read (m);
if eoln (input) then readln;
if m >= passmark then count := count +1
end;
{assert: count = number of passes in the set of n marks read}
Writeln (‘number of passes =’, count)
End.

Notes on design
1.      Initially, and each time through the loop, the variable count represents the number of passes so far encountered. On termination (when i=n) count represents the total number of passes in the set. Because i is incremented by 1 with each iteration, eventually the condition i<n will be violated and the loop will terminate.
2.      It was possible to use substitution to improve on the original solution to the problem. The simplest and most efficient solution to a problem is usually the best all-round solution.
3.      An end-of-line test is included to handle multiple lines of data.
Applications
All forms of counting.

refleksi minggu -1

semangatt pagi datang menghampiri, eng ing eng,,,,,, saat nya bersiap untuk berangkat kuliah disabtu pagi 09 maret 2013,, jam 06.30 cusssssssssssss deh ke kampus tercinta. Diperjalanan ±10 menit sekalian deh ngebayangin yang kata ny kuliah “Alpro” itu menegangkan dan penuh dengan kejutan. Sampe deh di parkiran, rutinitas biasanya (parkir,kampus,naik tangga, ruang). Jreenggg sampe dikelas eh ternyata pak dosen udah stand bay diruangan.. Jam 07.00 tepat kuliah dimulai, “WOW” baru pertama nemu Pak dosen yang kayak beginian,, susah dah pokoknya diungkapkan dengan kata kata, yang penting suasanane menegangkan sampe ndoplong semua (hahhahha). Kuliah selesai dan ditutup dengan tugas. Alhamdullillah…….

tugas alpro 3 chapter -3

Top-Down Design with Functions 1. Develop your program solutions from existing information. Use the system documentation derived from applying the software development method as the initial framework for the program. ■ Edit the data requirements to obtain the main function declarations. ■ Use the refined algorithm as the starting point for the executable statements in the main function. 2. If a new problem is an extension of a previous one, modify the previous program rather than starting from scratch. 3. Use C’s library functions to simplify mathematical computations through the reuse of code that has already been written and tested. Write a function call (consisting of the function name and arguments) to activate a library function. After the function executes, the function result is substituted for the function call. 4. Use a structure chart to show subordinate relationships between subproblems. 5. Utilize modular programming by writing separate function subprograms to implement the different subproblems in a structure chart. Ideally, your main function will consist of a sequence of function call statements that activate the function subprograms. 6. You can write functions without arguments and results to display a list of instructions to a program user or to draw a diagram on the screen. Use a function call consisting of the function name followed by an empty pair of parentheses () to activate such a function. 7. Write functions that have input arguments and that return a single result to perform computations similar to those performed by library functions. When you call such a function, each actual argument value is assigned to its corresponding formal parameter. 8. Place prototypes (similar to function headings) for each function subprogram before the main function, and place the function definitions after the main function in a source file. Use (void) to indicate that a function has no parameters.

Tugas alpro 3 chapter-2


Overview of C
2.1 C Language Elements
Preprocessor Directives
preprocessor directive a C program line beginning with # that provides an instruction to the preprocessor. preprocessor a system program that modifies a C program prior to its compilation library a collection of useful functions and symbols that may be accessed by a program

/*
* Converts distances from miles to kilometers.
*/
#include <stdio.h>
 /* printf, scanf definitions */
#define KMS_PER_MILE 1.609
 /* conversion constant */
int
main(void)
{
double miles,
/* distance in miles kms;
 /* equivalent distance in kilometers */
/* Get the distance in miles. */
printf("Enter the distance in miles> ");
scanf("%lf", &miles);
/* Convert the distance to kilometers. */
kms = KMS_PER_MILE * miles;
/* Display the distance in kilometers. */
printf("That equals %f kilometers.\n", kms);
return (0);

constant macro a name that is replaced by a particular constant value before the program is sent to the compiler comment text beginning with /* and ending with */ that provides supplementary information but is ignored by the preprocessor and compiler.

Syntax Displays for Preprocessor Directives
#include Directive for Defining Identifiers from
Standard Libraries
SYNTAX: #include <standard header file>
EXAPLES: #include <stdio.h>
                 #include <math.h>
INTERPRETATION: #include directives tell the preprocessor where to find the meanings of standard identifiers used in the program. These meanings are collected in files called standard header files. ThMe header file stdio.h contains information about standard input and output functions such as scanf and printf. Descriptions of common mathematical functions are found in the header file math.h . We will investigate header files associated with other standard libraries in later chapters.

#define Directive for Creating Constant Macros
SYNTAX: #define NAME value
EXAMPLES: #define MILES_PER_KM 0.62137
                     #define PI 3.141593
                     #define MAX_LENGTH 100
INTERPRETATION: The C preprocessor is notified that it is to replace each use of the identifier
NAME by value . C program statements cannot change the value associated with NAME .

Function main
declarations the part of a program that tells the compiler the names of memory cells in a program executable statements program executable statements program lines that are converted to machine language instructions and executed by the computer
EXAMPLE: int
main(void)
{
printf("Hello world\n");
return (0);
}

Reserved Words
reserved word a word that has special meaning in C
Standard Identifiers
standard identifier a word having special meaning but one that a programmer may redefine (but redefinition is not recommended!)

2.2 Variable Declarations and Data Types
Variable Declarations
variable a name associated with a memory cell whose value can change variable declarations statements that communicate to the compiler the names of variables in the program and the kind of information stored in each variable.

Data Types
data type a set of values and operations that can be performed on those values.
Data Type double A real number has an integral part and a fractional part that
are separated by a decimal point. In C, the data type double is used to represent
real numbers (for example, 3.14159 , 0.0005 , 150.0 ). You can store a real number
in a type double variable, perform the common arithmetic operations (add,
subtract, multiply, and divide), and compare them.

The ASCII Code
ASCII code a particular code that specifies the integer representing each char value.
Assignment Statements
assignment statement an instruction that stores a value or a computational result in a variable
Input/Output Operations and Functions
input operation an instruction that copies data from an input device into memory output operation an instruction that displays information stored in memory input/output function a C function that performs an input or output operation. function call calling or activating a function. function argument enclosed in parentheses following the function name; provides information needed by the function format string in a call to printf, a string of characters enclosed in quotes ("), which specifies the form of the output line print list in a call to printf, the variables or expressions whose values are displayed placeholder a symbol beginning with % in a format string that indicates where to display the output value newline escape sequence the character sequence \n, which is used in a format string to terminate an output line.
Syntax Display for printf Function Call
SYNTAX: printf( format string, print list );
printf( format string );
EXAMPLES: printf("I am %d years old, and my gpa is %f\n",
age, gpa);
printf("Enter the object mass in grams> ");

1. Every C program has preprocessor directives and a main function. The main
function contains variable declarations and executable statements.
2. Variable names must begin with a letter or an underscore (the latter not recommended)
and consist of letters, digits, and underscore symbols. A reserved
word cannot be used as an identifier.
3. C’s data types enable the compiler to determine how to store a particular
value in memory and what operations can be performed on that value.
Three standard data types are int , d ouble , and char . The data type of each
variable must be declared.
4. The executable statements are derived from the algorithm and are translated
into machine language. Assignment statements are used to perform
computations and store results in memory. Function calls are used to get
data (function scanf ) and to display values stored in memory (function
printf ).