1. Both main memory and secondary storage are types of memory. Describe the difference 
between the two.

2. What is the difference between system software and application software?

3. Why must programs written in a high-level language be translated into machine
language before they can be run?

4.  In C++, to display data on your monitor you use the << operator. What do you call this 
operator?

5. What is wrong with this program and how you fix it so it compiles?

int main()
}
// A crazy mixed up program
return 0;
#include <iostream>
cout << "In 1942 Columbus sailed the ocean blue.";
{
using namespace std;
 
6. A program has the following variable definitions.

long miles;
int feet;
float inches;

Write one cin statement that reads a value into each of these variables.

7. Write C++ statements using combined assignment operators to perform the following:
a) Add 6 to x
b) subtract 4 from amount
c) Multiply y by 4
d) divide total by 27
e) store in x the remainder of x divided by 7

8. Complete the following table by writing the value of each expression in the Value column

EXPRESSION  VALUE
-----------  -----
28/4  - 2

6 + 12 * 2 -8

4 + 8 * 2

6 + 17  % 3 - 2

2 + 22 * (9 - 7)
 
9. The following program ues an if/else if statement  to assign a letter grade 
     (A,B,C,D, or F) to a numeric test score. THE PROGRAM HAS ERRORS. Find as
     many as you can.

#include <iostream>
using namespace std;

int main() {

int testscore;
cout << "Enter your test score and I will tell you \n";
cout << "the letter grade you earned: ";
cin >> testscore;

if (testscore < 60)
   cout << "your grade is F.\n";
else if (testscore < 70)
   cout << "your grade is D.\n";
else if (testscore < 80)
   cout << "your grade is C.\n";
else if (testscore < 90)
   cout << "your grade is B.\n";
else 
   cout << "THAT IS NOT A VALID SCORE.\n");
else if (testscore <= 100)
   cout << your grade is A.\n");

return 0;
}

10. Write a program that asks the user to enter two numbers. The program should use the
    conditional operator to determine which number is the smaller and which is the larger.
 
11. Write a program that reports the contents of a compressed-gas cylinder based
   on the first letter of the cylinder's color. The program input is a character
   representing the observed color of the cylinder: 'Y' or 'y' for yellow, 'O' 
   or 'o' for orange, and so on. Cylinder colors and associated contents are as 
   follows:

Orange ammonia
  Brown  carbon monoxide
  Yellow  hydrogen
  Green  oxygen

Your program should respond to input of a letter other than the first letters
   of the given colors with the message, "contents unknown."

12. Write a program that uses a "for" statement to calculate the average of 
   several integers. Assume that the last value read is the sentinel value
   99999. For example, 10 8 7 13 9 9999 indicates that the program should 
   calculate the average of all the values preceding 9999

13.  Assume "value" is an integer variable. If the user enters 3.14 in response to the following 
programming statement, what will be stored in value?

int value;
    cin >> value;

a) 3.14
    b) 3
    c) 0

14.  You studied Type Casting in Chapter 3. Type casting allows you to perform manual data type
conversion.

Assume the following definitions:
       int a = 5, b = 12;
       double x = 3.4, z = 9.1;

What are the values of the following expressions?
     a) b/a
     b) x * a
     c) static_cast<double>(b/a)
     d) static_cast<double>(b) / a
     e) b / static_cast<int>x;

15. cout object provides a way to format the data that is displayed on the screen. To format data,
you include the header file <iomanip>.  To set the field width, you use the stream manipulator setw.
See Chapter 3. For example, if you like to display the number 15 in a field of width 5 spaces, you 
would write

int number = 15;
cout << setw(5) << number;

This will display the number in a field 5 spaces wide, right-justified. 
Write cout statement with stream manipulators that perform the following:
      a) Display the number 34.789 in a field of 9 spaces with 2 decimal places of precision
      b) Display the number 67 left justified in a field of 7 spaces.

16.  Indicate whether the following statements about relational expressions are correct or incorrect.
    a) x <= y is the same as y > x
    b) x != y is the same as y >= x
    c) x >= y is the same as y <= x

17. Rewrite the following code using a do-while statement with no decisions in the loop body: 
   sum = 0;
   for (odd = 1; odd < n; odd = odd + 2)
   sum = sum + odd;

18. What three things do you need to do to use a function in your program? Explain each one of them 
giving examples.  

c++程序代写(qq:928900200)的更多相关文章

  1. C语言程序代写(QQ:928900200)

    1.学生成绩统计 要求描述: 用结构数组实现学生信息的统计功能. struct student { long no; /*学号*/ char name[10]; /*姓名*/ char sex; /* ...

  2. SmileyCount.java笑脸加法程序代写(QQ:928900200)

    SmileyCount.java 1/4Java Programming 2014Course Code: EBU4201Mini ProjectTask 1 [30 marks]SmileyCoun ...

  3. java程序开发代写(QQ:928900200)

    条件:手机1.2都是安卓智能机,手机1开热点,手机2链接手机1,功能:A手机2通过刷手机网页,登陆手机1设定的页面并下载其手机的指定文件,B手机1控制手机2的流量,当通过的流量多的时候,停止流量的供应

  4. C++程序代写实现HashSet class

    C++程序代写实现HashSet class 专业程序代写(QQ:928900200) Implement a HashSet class for elements of type string.It ...

  5. 基于JAVA WEB技术旅游服务网站系统设计与实现网上程序代写

    基于JAVA WEB技术旅游服务网站系统设计与实现网上程序代写 专业程序代写服务(QQ:928900200) 随着社会的进步.服务行业的服务水平不断发展与提高,宾馆.酒店.旅游等服务行业的信息量和工作 ...

  6. 如何鉴别程序抄袭c语言程序代写

    如何鉴别程序抄袭:如何鉴别一份程序代码是抄袭另一份程序.输入:两个C语言源程序文件 输出:抄袭了多少?给出最相似的片段,判断是谁抄袭了谁? 提示:首先进行统一规范化排版,去掉无谓的空格.空行,然后比对 ...

  7. c编写程序完成m名旅客和n辆汽车的同步程序代写

    jurassic公园有一个恐龙博物馆和一个公园,有m名旅客和n辆汽车,每辆汽车仅能允许承载一名旅客.旅客在博物馆参观一阵,然后排队乘坐旅行车.当一辆车可用时,他载入一名旅客,再绕花园行驶任意长的时间. ...

  8. 实验教学管理系统 c语言程序代写源码下载

    问题描述:实验室基本业务活动包括:实验室.班级信息录入.查询与删除:实验室预定等.试设计一个实验教学管理系统,将上述业务活动借助计算机系统完成. 基本要求: 1.必须存储的信息 (1)实验室信息:编号 ...

  9. 模拟游客一天的生活与旅游java程序代写源码

    在某个城市的商业区里,有一家首饰店,一家饭店,一家面馆,一家火锅店,一家银行,一家当铺 现在有一群来自四川的游客,一群陕西的游客,一群上海的游客,和以上各店家的工作人员在此区域里,请模拟他们一天的生活 ...

随机推荐

  1. LCD显示--Ht1621b芯片显示屏驱动

    Ht1621b芯片显示屏驱动 关于HT1621b芯片的具体信息能够參考数据手冊上的内容:百度文库HT1621b中文资料 CS : 片选输入接一上拉电阻当/CS 为高电平读写HT1621的数据和命令无效 ...

  2. Spring Bean范围 示例

    Spring 该目的是通过默认单身创建的对象 设定Bean范围.由Bean美元Scope财产 Scope取值范围: Singleton:单例 proptotype:非单例 Request:创建该Bea ...

  3. vc++远程调试工具

    简单来说: 1>在远程机器跑VC自带的远程调试工具msvsmon.exe,并把要调试的程序跑起来 2>用VC调试器附加进程,即可调试 先展开来说: VC8,VC9都自带远程调试工具,可以在 ...

  4. data URI scheme及其应用

    data URI scheme通俗的来讲就是将一张图片直接塞到HTML中而不是通过HTTP请求去获取.这样从表面上看会降低一次HTTP的请求,实现了对于网页的优化(只是看了其它一些文章data URI ...

  5. [Android学习笔记]子线程更新UI线程方法之Handler

    关于此笔记 不讨论: 1.不讨论Handler实现细节 2.不讨论android线程派发细节 讨论: 子线程如何简单的使用Handler更新UI 问题: android开发时,如何在子线程更新UI? ...

  6. ExtJS学习-----------Ext.Array,ExtJS对javascript中的Array的扩展

    关于ExtJS对javascript中的Array的扩展.能够參考其帮助文档,文档下载地址:http://download.csdn.net/detail/z1137730824/7748893 因为 ...

  7. HDU 3571 N-dimensional Sphere(高斯消元 数论题)

    这道题算是比较综合的了,要用到扩展欧几里得,乘法二分,高斯消元. 看了题解才做出来orz 基本思路是这样,建一个n*(n-1)的行列式,然后高斯消元. 关键就是在建行列式时会暴long long,所以 ...

  8. C#语言实现ArcGIS数据源重置之Set Data Source功能

    1.须要:依据选择的Mxd路径和目标数据源路径进行重置数据源.此处以(.Mdb为例): 主要利用到的接口: (1)IMapDocument    (2)IMapControl2     (3)IWor ...

  9. poj-2195-Going Home最小费用最大流

    重新切一遍最小费用最大流~~~ 这到题目的数据范围有问题,尽量开大就好了~~ #include<stdio.h> #include<iostream> #include< ...

  10. poj 2586 Y2K Accounting Bug(贪心算法,水题一枚)

    #include <iostream> using namespace std; /*248K 32MS*/ int main() { int s,d; while(cin>> ...