Junior Midterm.

Source: Internet
Author: User

Do it yourself, for reference only. Right and wrong ego

Zhanjiang Teachers College the - - year of study first 1 Semester

Midterm papers

Subjects:LINUX platforms and Applications

Check

+

TD Width= "All" >

Question number

One,

Action

Two,

C programming

Tri,

Shell programming

Four,

debate

Total score

score

score

+

+

+

+

Cai Guangqi

 

Score b>

Score

Marking person

Cai Guangqi

First, the operation problem. Add a 1.0GB hard drive with a partition of/DEV/SDB1 (10 points) and format it (5 points). Automatically mounts it to/mnt/b (10 points) each time it is powered on. Try to write specific steps.

1. Open the VMware Workstation, click on the menu bar "virtual machine" → "settings" → under "hardware" select "Hard Disk (SCSI)" → add → press 3 times "continue" → Max hard disk size set to 1.0g→ press "continue" → Complete

#查看磁盘分区情况

Fdisk–l

#对/DEV/SDB partition is/DEV/SDB1

Fdisk/dev/sdb

Command (M for help): N

P

Partition number (1-4): 1

First cylinder (1-512, default 1): 1

Last cylinder or +size or +sizem or +sizek (1-512, default): +1024m

W

#查看磁盘分区情况

Fdisk–l

#格式化/DEV/SDB1

Mkfs-t EXT3/DEV/SDB1

# Create/mnt/b and/mnt/b/yanzheng, mount to/mnt/b, etc will reboot Mount succeeds, #/mnt/b/yanzheng will give overwrite, that means Mount succeeded.

Mkdir/mnt/b

Mkdir/mnt/b/yanzheng

Cd/mnt/b

Ls

Cat >>/etc/fstab

#向/etc/fstab file, add the following command

/dev/sdb1/mnt/b ext3 defaults 0 0

#ctrl-D end Edit, save content

Keyboard press ctrl-d at the same time

#重启让其生效

Reboot

Cd/mnt/b

Ls

Screen Display Lost+found

#/mnt/b/yanzheng will give coverage, that means the mount was successful.

Score

Marking person

Cai Guangqi

Second, C programming and mapping.

1, write the C program, output the coordinates of one of the following graphs vertex:

(a) helical (b) helical

If the number is singular (a), the number is a double person (b). (15 points)

2, according to 1, the output, with Gnuplot drawing. (5 points)

3. In Windows, view the diagram in a browser. (5 points)

Answer: 1. Cat > Hexagon.c

#include <stdio.h>

#include <math.h>

Main () {

int n,x=25,y=0;

printf ("%d%d\n", x, y);

for (n=25;n>0;) {

if (n==1) {

X=x-n;

printf ("%d%d\n", x, y);

Break

}

X=x-n;

printf ("%d%d\n", x, y);

Y=y+n;

printf ("%d%d\n", x, y);

n--;

X=x+n;

printf ("%d%d\n", x, y);

Y=y-n;

printf ("%d%d\n", x, y);

n--;

}

}

2. Enter ftp://192.168.80.3 in the Address bar of the window and press ENTER to

"File" → "login", enter Yanji, password: yanji123, copy the gnuplot-3.7.3-2.i386.rpm to the/home/yanji directory and enter it in the Linux terminal.

Cd/home/yanji

RPM–IVH gnuplot-3.7.3-2.i386.rpm

Warning:gnuplot-3.7.3-2.i386.rpm:v3 DSA Signature:nokey, key ID db42a60e

Preparing ... ########################################### [100%]

Package gnuplot-3.7.3-2 is already installed# (already installed)

Gcc-c HEXAGON.C

Gcc-o Hexagon HEXAGON.O–LM

./hexagon > Hexagon.dat

Cat > HEXAGON.P

#! /usr/bin/gnuplot

Set Terminal png

Set Output "/var/www/html/hexagon.png"

Set size ratio 1

Plot ' Hexagon.dat ' with lines

#键盘按ctrl-D End Input

Gnuplot HEXAGON.P

2. In Windows, open the browser, enter http://192.168.23.3/hexagon.png in the Address bar to view the picture

Score

Marking person

Cai Guangqi

Third, write the shell script mean, to find the average number of real numbers, the result is reserved two decimal places. The batch of real numbers as command-line arguments. (25 points)

Answer: Cat > Mean

#开始输入程序

#! /bin/bash

DECLARE x Z

S=0

For x in $*

Do

S= $s + $x

Done

Z= ' echo ' ($s)/$# | Bc-l '

printf "%.2f\n" $z

#按ctrl-D end input, start assigning permissions, perform operations

chmod +x mean

./mean 1.5 3.6 67.55 76.46 675.6

#实验最终结果 [[email protected] yanji]#./mean 1.5 3.6 67.55 76.46 675.6

164.94

Score

Marking person

Cai Guangqi

Debate title: Unix/linux is superior to Windows. The number for the singular is the affirmative, the study number is the opposite. No more than 300 words.

For:

Unix/linux is a powerful multi-user, multi-tasking operating system, with high reliability, scalability, openness, open source, strong network functions, a good network support for file system support, strong database support functions, high degree of modularity, extensive hardware support, security and reliability good, With excellent development tools and other advantages. These are the things that Windows cannot do.

Windows crashes all day, need to optimize tools such as master optimization, hard disk for a long time will be fragmented, slow down, need a program to tidy up, do not do other work. Linux does not need to be optimized because the Linux kernel itself is highly optimized. Because its file system is much better, and a lot of unix/linux system is must be 24 hours a day, 365 and 1/4 days a year to keep running, Linux system installed after the hardware can be supported more than Windows.

Junior Midterm.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.