SlideShare ist ein Scribd-Unternehmen logo
1 von 133
Downloaden Sie, um offline zu lesen
Lab2
เข้าโปรแกรมDEV+++
ให้นิสิตสร้างโปรแกรมรับค่าเลขจานวนเต็ม2จานวนและหาผลบวกของทั้ง2จานวน
ส่วนที่1
intnum1, num2;
ส่วนที่2
intsum;
การออกแบบ
ซูโดโค้ด
START
READ num1 ;
READ num2 ;
COMPUTE SUM = num1+num2 ;
PRINTSUM ;
STOP
เข้าไปที่คาสั่งsource (ctrl+n)
เขียนคาสั่งโปรแกรม
ไปที่คาสั่งดังรูปเพื่อทา
การเซฟไฟล์
เซฟไฟล์เปลี่ยนนามสกุลตามรูปแล้วกดsave
ไปที่คาสั่งcompile &run(F9) จะได้ผลลัพธ์ดังนี้
เข้าโปรแกรม
#include <stdio.h>
voidmain()
{
intnum1,num2,sum;
printf("Please Number1:");
scanf("%d",&num1);
printf("Please Number2:");
scanf("%d",&num2);
sum= num1* num2;
printf("Samof %dx %d= %d",num1,num2,sum);
getch();
return0;
}
Lab3
เช้าโปรแกรม
#‎include <stdio.h>
voidmain()
{
floatw1,w2,h,area;
printf("pleaseinsertside:");
scanf("%f",&w1);
printf("Pleaseinsertside2:");
scanf("%f",&w2);
printf("Pleaseinserttoheight:");
scanf("%f",&h);
area = 0.5 * (w1+w2)*h;
printf("areaof trapezoid 0.5*(%f +%f)*%f=%f",w1,w2,h,area);
getch();
return0;
}
Lad4
เข้าโปรแกรม
publicclassstring_test{
publicstaticvoidmain(String[]args){
Stringname;
intcount;
Scannerkeyboard= newScanner(System.in);
System.out.println("Pleaseinsertyourname:");
name = keyboard.nextLine();
count= name.length();
System.out.println(name+""+"has"+"count+"+"Charcter.");
#include <stdio.h>
voidmain()
{
char name [30}="";
printf("Please insertyourname:");
scanf("%s",&name);
printf("%shas%dCharacter.",strlen(name));
getch();
return0;
}
Save fild
Lab5
#include "stdio.h"
voidmain()
{
char ch1 = 'g';
char ch2 = 'k';
printf("Ch1=%dna",ch1);
printf("Ch1=%dna",ch2);
if(ch2< ch1)
{
printf("Ch2more thanCh1na");
}
printf ("goodbay");
getch();
return0;
}
#include "stdio.h"
voidmain()
{
char ch1;
char ch2;
printf("PleaseinsertCharch1:");
scanf("%c",&ch1);
printf("PleaseinsertCharch2:");
scanf("%c",&ch2);
printf("Ch1:%dn",ch1);
printf("Ch2:%dn",ch2);
if(ch2< ch1)
{
printf("Ch2more thanCh1na");
}
printf ("goodbay");
getch();
return0;
}
#include "stdio.h"
voidmain()
{
intage;
printf("Howoldare you:");
scanf("%d",&age);
if(age>=60)
{
printf("Youare older!!!!n");
}
printf("GoodBay");
getch();
return0;
}
Lab6
#include "stdio.h"
voidmain()
{
int score;
printf ("Please insertyourscore:");
scanf("%d",&score);
if((score>=80)&&(score<=100))
printf("Youare Grade A");
else if((score>=75)&&(score<=79))
printf("Youare Grade B+");
else if((score>=70)&&(score<=74))
printf("Youare Grade B");
else if((score>=65)&&(score<=69))
printf("Youare Grade C+");
else if((score>=60)&&(score<=64))
printf("Youare Grade C");
else if((score>=55)&&(score<=59))
printf("Youare Grade D+");
else if((score>=50)&&(score<=54))
printf("Youare Grade D");
else
printf("Youare Grade F");
getch();
return0;
}
Lab7
#include "stdio.h"
voidmain()
{
char menu;
intcounter;
for(counter=1;counter<=4;counter++)
{
printf("nPlease insertyourorder:");
scanf("%c",&menu);
switch(menu)
{
case 'p' : printf("PapayaSalad");
break;
case 't' : printf("TomyamKung");
break;
case 'i' : printf("Padthai");
break;
case 'l' : printf("labmoo");
break;
default:printf("tryagain");
}
}
getch();
return0;
}
ทดสอบ
Lab8
Lab9
การลงแอปพิเคชั้นgoogle >> app inventor2
เลือก I accept the terms of service
เลือก continue >> MIT App Inventor 2
หน้าจอที่พร้อมแสดงการทางาน
การล็อกอินการทางาน
โปรแกรมการจาลองเพื่อแสดงการทางานบนหน้าจอการทางาน google>>ai2starter>>ลิงค์แรก>>Create app
ทาการเลือกตามหน้าต่างที่กาหนด
จากนั้นทาการเลือกที่ Download the installer
Run จะสาเร็จ
การสร้าง Projects>>My Projects>> Projects name >>Ok
Lab10
กดCreate apps!
สมัครเข้าการใช้งาน
ไปค้นหา ai2starter เลือก ลิงค์แรก
กดที่ Download
กลับไปที่ MIT App Invertor >> Projects>> start new Project
ตั้งชื่อ Project >> week11_camera
Lab11
เข้า Google ค้นหาappinven
ลบ
เรียกimage (ลากมาวาง)เพื่อเรียกรูป
ลากButtonเพื่อกด
ไปที่ Media>> camera (สาหรับถ่าภาพ)
ไปที่ Storage (เป็นการจัดเก็บภาพ)>>TinyDBI
ไปที่มุมขวาบนเลือก Blocks(จะได้หน้าต่างแสดงการเขียนApp)
เลือกในช่องซ้ายมือButton>> เลือกตัวแรก
เรียกเมนูกล้อง
เมนูการจัดเก็บ
ไปที่ TinyDB1
เพื่อทาการจัดเก็บ
เป็นการตั้งค่ารูป
ไปที่ Text>> เลือกตัวแรก(“..”)
ใช้ชื่อว่า “Pic” เป็นการตั้งชื่อรูปภาพในการถ่ายภาพ
ไปที่ Variables>>get
เป็นการเรียกภาพที่ชื่อPic
จากนั้นไปที่ Build>> App(provide QRcode for .apk)
Lab12
เปิด Appinvertor.mit.edu
เปิดหน้าเขียนเว็บขึ้นมา
ไปที่ Project>> NewProject
ตั้งชื่อ Project:week12_g3301_56_GPS >> OK
ไปที่ Layout
กลับไปที่ User Interface >> Label (ลากมา)
เปลี่ยนชื่อทางขวามือ ตรงช่อง Text>> Latitude:
เลือกLabel ลากมาปล่อยข้างหลังLatitude (เป็นการแสดงค่าเวลาเรียกใช้งาน)
เพื่อไม่สับสนให้เปลี่ยนชื่อLabel 2 ให้เลือกRename ตั้งชื่อเป็น LatitudeLabel >>OK
เปลี่ยนชื่อLabel3>> เป็น show
ลากLabel เปลี่ยนชื่อทางขวามือText>> Longitude:
ลากLabel เปลี่ยนชื่อ0
ทาการเปลี่ยนชื่อชื่อLabel2>> LongitudeLabel
เปลี่ยนชื่อLabal3
ไปเพิ่มช่อง กดที่ TabelArrangement>>ลากLabel เปลี่ยนชื่อ
ลากLabel มาเปลี่ยนชื่อ0 >> ทาการเปลี่ยนชื่อLabel2ในช่องขวามือ
เปลี่ยนชื่อLabel3
ลากLabel เปลี่ยนเป็นDistence:
ลากLabel มาต่อข้างหลังเปลี่ยนชื่อ0
ไปที่ Blocksเพื่อทาการเริ่มเขียนและใช้โปรแกรม
ไปที่ ช่องซ้ายมือLocation
Lab13
เปิด MATLAB R2013a
ไปที่ Browse forfolder
เปิดไฟล์ที่ต้องการไปที่ Local Disk(D) >>computer_gi59>>group3301_59>>เลือก DEM >>SelectFolder
จากนั้นพิมพ์>> DEW = GRIDobj (‘kidchakood.tif’) >>Enter(เราจะได้ชื่อลักษณะ)
จากนั้นพิมพ์imagesc(DEW) >> enter
จะได้ภาพที่แสดงสีออกมา
จากนั้นทาภาพให้มีมิติมากขึ้นพิมพ์imageschs(DEW,min(gradient8(DEW),1)) >>enter
จะได้ภาพที่เป็นมิติขึ้นมาพร้อมกับไล่ระดับสี
พิมพ์ DEWc = crop (DEW,sub2ind(DEW.size,[150350],[150350]));เพื่อทาการตัดภาพ
พิมพ์ [Z,x,y] = GRIDobj2mat(DEWc);>> enter
พิมพ์ surf(x,y,double(Z))
พิมพ์ GRIDobj2geotiff(DEWc,'test.tif'); >>enter
DEWf = fillsinks(DEW); (การหาร่องน้า)
Flowacc(FD)การไหลสะสม
imageschs(DEW,dilate(sqrt(A),ones(5)),'colormap',flipud(copper)); เป็นการแสดงภาพร่องน้า
DB = drainagebasins(FD); การระบายน้า
DB = shufflelabel(DB);เป็นการแยกลาน้า
กด ที่ run จะขึ้นหน้าต่างเพื่อทาการจัดเก็บ
Lab14
เปิด MATLAB
เลือกรูปมา1รูปทาการsave ไว้ในDiskD>> สร้างโฟเดอร์ image
ทาการเรียนรูปภาพพิมพ์โค้ด pic1= imread(‘pic1.jpg’) >>Enter
จะได้หน้าต่างแสดงแบบนี้จากนั้นทาการเคลียหน้าต่างพิมพ์clc>> Enter
หน้าต่างเรียกรูปภาพถ้าเราพิมพ์แค่figureแล้วEnterมันจะขึ้นแค่หน้าต่างเรียกรูปภาพแต่เรายังไม่ได้กาหนดชื่อภาพ
จากนั้นพิมพ์โค้ดให้สมบูรณ์ figure,imshow(pic1) >> Enter
จะได้ภาพที่ต้องการ
โค้ดคาสั่งทาภาพเป็นขาวดา(โค้ดแรกทาการอ่านภาพ)
โค้ด เรียกภาพเป็นขาวดา
เป็นโค้ดอ่านค่ากราฟสี
แสดงกราฟสี
ทาการแปลงภาพสีเป็นขาวดาbw
ทาการเรียกภาพที่2ขึ้นมา
จะได้ภาพที่2ที่เราต้องการ
ทาการปรับภาพให้คมชัดมากขึ้น
ทาการดูกราฟสี(กราฟสีแบบเดิมไม่ได้ปรับแก้)
แสดงกราฟที่ปรับสีแล้วให้ชัดขึ้น
เลือก BlankGUI >> OK
แสดงกราฟ
ลากในหน้ากระดาษ
Lab15
เปิดโปรแกรมMATLAB
จะได้หน้าต่าง
ทาการไฟล์ภาพ3ภาพและทาการแก้สีภาพ
การแบ่งการรวม(cat) รวมภาพให้เป็นภาพสี
ได้ภาพที่เป็น ndvi
56670274

Weitere ähnliche Inhalte

Andere mochten auch

[울산]Designed design 사업 소개
[울산]Designed design 사업 소개[울산]Designed design 사업 소개
[울산]Designed design 사업 소개
startupkorea
 
[대구] 이대공 기업 홍보문서
[대구] 이대공 기업 홍보문서[대구] 이대공 기업 홍보문서
[대구] 이대공 기업 홍보문서
startupkorea
 
Suspension o perdida de los derechos ciudadanos
Suspension o perdida de los derechos ciudadanosSuspension o perdida de los derechos ciudadanos
Suspension o perdida de los derechos ciudadanos
KARLA MORALES YUGSAN
 

Andere mochten auch (20)

Face of Cook
Face of CookFace of Cook
Face of Cook
 
Dvt500
Dvt500Dvt500
Dvt500
 
Heartland Girls Ranch
Heartland Girls RanchHeartland Girls Ranch
Heartland Girls Ranch
 
[울산]Designed design 사업 소개
[울산]Designed design 사업 소개[울산]Designed design 사업 소개
[울산]Designed design 사업 소개
 
So We Meet Again My Heartache
So We Meet Again My HeartacheSo We Meet Again My Heartache
So We Meet Again My Heartache
 
FPA:s förmåner vid sjukdom
FPA:s förmåner vid sjukdomFPA:s förmåner vid sjukdom
FPA:s förmåner vid sjukdom
 
Mapa mental
Mapa mentalMapa mental
Mapa mental
 
[대구] 이대공 기업 홍보문서
[대구] 이대공 기업 홍보문서[대구] 이대공 기업 홍보문서
[대구] 이대공 기업 홍보문서
 
Ciclo de vida de las torugas Golfinas
Ciclo de vida de las torugas GolfinasCiclo de vida de las torugas Golfinas
Ciclo de vida de las torugas Golfinas
 
Ecosistemas y áreas naturales protegidas de méxico
Ecosistemas y áreas naturales protegidas de méxicoEcosistemas y áreas naturales protegidas de méxico
Ecosistemas y áreas naturales protegidas de méxico
 
Quiz 1 2
Quiz 1 2Quiz 1 2
Quiz 1 2
 
Paul feyerabend
Paul feyerabendPaul feyerabend
Paul feyerabend
 
Energy poverty related to the type of heating – Macedonia as a case study
Energy poverty related to the type of heating – Macedonia as a case studyEnergy poverty related to the type of heating – Macedonia as a case study
Energy poverty related to the type of heating – Macedonia as a case study
 
The problematisation of fuel poverty in the UK, Ireland and France: material ...
The problematisation of fuel poverty in the UK, Ireland and France: material ...The problematisation of fuel poverty in the UK, Ireland and France: material ...
The problematisation of fuel poverty in the UK, Ireland and France: material ...
 
Fuel poverty in post-industrial regions on the example of Silesian voivodeship
Fuel poverty in post-industrial regions on the example of Silesian voivodeshipFuel poverty in post-industrial regions on the example of Silesian voivodeship
Fuel poverty in post-industrial regions on the example of Silesian voivodeship
 
Introducing household energy inequality across income levels: Evidence from CEE
Introducing household energy inequality across income levels: Evidence from CEEIntroducing household energy inequality across income levels: Evidence from CEE
Introducing household energy inequality across income levels: Evidence from CEE
 
Living under domestic energy deprivation in Brussels: when your life become a...
Living under domestic energy deprivation in Brussels: when your life become a...Living under domestic energy deprivation in Brussels: when your life become a...
Living under domestic energy deprivation in Brussels: when your life become a...
 
Suspension o perdida de los derechos ciudadanos
Suspension o perdida de los derechos ciudadanosSuspension o perdida de los derechos ciudadanos
Suspension o perdida de los derechos ciudadanos
 
Mood structure
Mood structureMood structure
Mood structure
 
Mood
MoodMood
Mood
 

Ähnlich wie 56670274

Authorware
AuthorwareAuthorware
Authorware
pui3327
 
การเข้าใช้โปรแกรมซี Dev C++
การเข้าใช้โปรแกรมซี Dev C++การเข้าใช้โปรแกรมซี Dev C++
การเข้าใช้โปรแกรมซี Dev C++
dechathon
 
คู่มือการอบรมครู การพัฒนาสื่อการเรียนการสอน ด้วย MIT App Inventor
คู่มือการอบรมครู การพัฒนาสื่อการเรียนการสอน ด้วย MIT App Inventorคู่มือการอบรมครู การพัฒนาสื่อการเรียนการสอน ด้วย MIT App Inventor
คู่มือการอบรมครู การพัฒนาสื่อการเรียนการสอน ด้วย MIT App Inventor
Somchart Phaeumnart
 

Ähnlich wie 56670274 (20)

Week2
Week2Week2
Week2
 
Week2
Week2Week2
Week2
 
Week3
Week3Week3
Week3
 
3.8 การทำงานแบบลำดับ
3.8 การทำงานแบบลำดับ3.8 การทำงานแบบลำดับ
3.8 การทำงานแบบลำดับ
 
Authorware
AuthorwareAuthorware
Authorware
 
ตัวอย่างคู่มื่อ Profile Builder 2.1.7 ภาษาไทย
ตัวอย่างคู่มื่อ Profile Builder 2.1.7 ภาษาไทยตัวอย่างคู่มื่อ Profile Builder 2.1.7 ภาษาไทย
ตัวอย่างคู่มื่อ Profile Builder 2.1.7 ภาษาไทย
 
การเข้าใช้โปรแกรมซี Dev C++
การเข้าใช้โปรแกรมซี Dev C++การเข้าใช้โปรแกรมซี Dev C++
การเข้าใช้โปรแกรมซี Dev C++
 
Unit3
Unit3Unit3
Unit3
 
Know1 1
Know1 1Know1 1
Know1 1
 
Week11
Week11Week11
Week11
 
คู่มือการอบรมครู การพัฒนาสื่อการเรียนการสอน ด้วย MIT App Inventor
คู่มือการอบรมครู การพัฒนาสื่อการเรียนการสอน ด้วย MIT App Inventorคู่มือการอบรมครู การพัฒนาสื่อการเรียนการสอน ด้วย MIT App Inventor
คู่มือการอบรมครู การพัฒนาสื่อการเรียนการสอน ด้วย MIT App Inventor
 
นางสาวศศินิภา ซิ้มศิริ รหัสนิสิต 58670396
นางสาวศศินิภา ซิ้มศิริ รหัสนิสิต 58670396นางสาวศศินิภา ซิ้มศิริ รหัสนิสิต 58670396
นางสาวศศินิภา ซิ้มศิริ รหัสนิสิต 58670396
 
Android programming
Android programmingAndroid programming
Android programming
 
Tutorial android
Tutorial androidTutorial android
Tutorial android
 
3.8 การทำงานตามลำดับ
3.8 การทำงานตามลำดับ3.8 การทำงานตามลำดับ
3.8 การทำงานตามลำดับ
 
56170059
5617005956170059
56170059
 
การเขียนโปรแกรม
การเขียนโปรแกรมการเขียนโปรแกรม
การเขียนโปรแกรม
 
ก่อนเรียนประมวลผลคำ
ก่อนเรียนประมวลผลคำก่อนเรียนประมวลผลคำ
ก่อนเรียนประมวลผลคำ
 
ก่อนเรียนประมวลผลคำ
ก่อนเรียนประมวลผลคำก่อนเรียนประมวลผลคำ
ก่อนเรียนประมวลผลคำ
 
Learn 2
Learn 2Learn 2
Learn 2
 

Mehr von WanSurang FK (20)

Week15
Week15Week15
Week15
 
Week14
Week14Week14
Week14
 
Week13
Week13Week13
Week13
 
Week12
Week12Week12
Week12
 
Week11
Week11Week11
Week11
 
Week10
Week10Week10
Week10
 
Week9
Week9Week9
Week9
 
Week8
Week8Week8
Week8
 
Week 7
Week 7Week 7
Week 7
 
Week6
Week6Week6
Week6
 
Week5 (1)
Week5 (1)Week5 (1)
Week5 (1)
 
Week4 (2)
Week4 (2)Week4 (2)
Week4 (2)
 
Week 3
Week 3Week 3
Week 3
 
Week2
Week2Week2
Week2
 
56670274
5667027456670274
56670274
 
Week15
Week15Week15
Week15
 
Week14
Week14Week14
Week14
 
Week13
Week13Week13
Week13
 
Week12
Week12Week12
Week12
 
Week11
Week11Week11
Week11
 

56670274