首页 > > 详细

Java辅导:CS2360 Print a Butterfly讲解Java程序、Java程序解析

Java,。

Problem-1 Printing Figures

Write a program that takes one positive integer as input and assume the integer is n. You program will print a figure according to the value of n. Some samples are displayed as below.

Problem-2 Print a butterfly

Implement the program that takes an integer n as input and prints out the following pattern.

n is an input integer, and you may assume n is less than 10 and n is nonnegative. Note the spacing and how the digits align between different lines.

Problem-3 Prime numbers

Implement the program that takes an integer n and output all the prime numbers in increasing order that satisfy the three requirements: 1) no more than n (includes n); 2) the last digit of the prime numbers cannot be 3; and 3) the sum the printed numbers cannot be larger than 3n. Check Wiki if you need the definition of prime numbers.

Submission Guidelines

What if I do not follow the suggested filenames (e.g., A.java)?

  • You should put your programs into the Source Programs, and only Source program need to be submitted.
  • Your assignment may be missed and may not be marked.

What is “Programming Skills”?

  • Document your source programs properly (e.g., put appropriate comments at appropriate places in your source programs)
  • Name the variables in the meaningful ways
  • Use proper indentation
  • Your programs are well designed and easily readable

How do you mark my assignment?

  • For each problem, we have several test cases. Also, we will read your program.
  • If your program does not show correct answers, some (or all) marks will be deducted depending on the mistakes/errors you make.
  • If your program has “compilation errors”, NO MARK will be given.
  • For each problem, we mark your “programming skills”. As long as your “programming skills” is acceptable, no mark will be deducted

What else I should know?
Each source program must start with the following comments:

1
2
3
// Name: (Your name)
// Student ID: (Your student ID)
// Lab section: (Your lab session) (e.g., T01)

 

联系我们
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!