-CoderOilStation   课程类别:计算机 课程名:CPSC110 系统程序设计环节

 

-CoderOilStation

 

课程类别:计算机

课程名:CPSC110 系统程序设计环节 Systematic Program Design

 

 

mt2-p6-solution

#reader(lib "htdp-intermediate-lambda-reader.ss" "lang")((modname mt2-p5-solution) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f () #t))) (require spd/tags) (require 2htdp/image) (@assignment exams/2022w2-mt2/mt2-p6) (@cwl ???)   ;fill in your CWL here (same as for problem sets) (@problem 1) ;do not edit or delete this line (@problem 2) ;do not edit or delete this line (@problem 3) ;do not edit or delete this line (@problem 4) ;do not edit or delete this line (@problem 5) ;do not edit or delete this line (@problem 6) ;do not edit or delete this line #| In this problem you must complete the design of the function with an appropriate @template-origin and function definition.  You should consult the mt2-p5-figure.pdf file which provides some additional help designing the function. YOU ARE NOT PERMITTED TO USE THE STEPPER AT ANY POINT IN THIS EXAM. In this problem you must complete the design of a function by writing the template origin tag and the function definition.  This problem will be autograded.  NOTE that all of the following are required. Violating one or more will cause your solution to receive 0 marks.   - The file MUST NOT have any errors when the Check Syntax button is pressed.     Press Check Syntax and Run often, and correct any errors early.   - The function definition MUST call one or more built-in abstract functions.   - The function definition MUST NOT be recursive.   - The function definition MUST NOT use any part of the recursive Natural     template or the (listof X) template. For instance,       - it must not include (cond [(empty? ... anywhere       - it must not include (cond [(zero? ... anywhere       - it must not include (first loc) anywhere   - You MUST NOT change or comment out any check-expects, and you must not     change the order of the existing check-expects, but you are free to add     new check-expects AFTER the existing check-expects.   - The result of the function must directly be the result of one of the     built-in abstract functions. So, for example, the following would not     be valid function body:        (define (foo x)          (empty? (filter ...)))  - For maximum credit your answer should be a composition of foldr and    build-list. |# (define SIZE 10) (define COLOR "blue") (define PEN "solid") (@htdf pyramid) (@signature Natural -> Image) ;; produce a pyramid with n-1 visible steps on each side (steps are 10x10) (check-expect (pyramid 0) empty-image) (check-expect (pyramid 1)               (beside/align "bottom"                             (rectangle SIZE (* SIZE 1) PEN COLOR)                             empty-image                             (rectangle SIZE (* SIZE 1) PEN COLOR))) (check-expect (pyramid 2)               (beside/align "bottom"                             (rectangle SIZE (* SIZE 1) PEN COLOR)                             (rectangle SIZE (* SIZE 2) PEN COLOR)                             empty-image                             (rectangle SIZE (* SIZE 2) PEN COLOR)                             (rectangle SIZE (* SIZE 1) PEN COLOR))) (check-expect (pyramid 3)               (beside/align "bottom"                             (rectangle SIZE (* SIZE 1) PEN COLOR)                             (rectangle SIZE (* SIZE 2) PEN COLOR)                             (rectangle SIZE (* SIZE 3) PEN COLOR)                             empty-image                             (rectangle SIZE (* SIZE 3) PEN COLOR)                             (rectangle SIZE (* SIZE 2) PEN COLOR)                             (rectangle SIZE (* SIZE 1) PEN COLOR))) (@template-origin fn-composition use-abstract-fn) (define (pyramid n)   (foldr (lambda (r rnr)            (beside/align "bottom" r rnr r))          empty-image          (build-list n                      (lambda (n)                        (rectangle SIZE (* (+ n 1) SIZE) PEN COLOR)))))

 

 

mt2-p5-solution

#reader(lib "htdp-intermediate-lambda-reader.ss" "lang")((modname mt2-p5-starter) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f () #t))) (require spd/tags) (require 2htdp/image) (@assignment exams/2022w2-mt2/mt2-p5) (@cwl ???)   ;fill in your CWL here (same as for problem sets) (@problem 1) ;do not edit or delete this line (@problem 2) ;do not edit or delete this line (@problem 3) ;do not edit or delete this line (@problem 4) ;do not edit or delete this line (@problem 5) ;do not edit or delete this line (@htdf largest) (@signature (listof (listof Natural)) -> (listof Natural)) ;; produce list of largest numbers in each sublist ;; CONSTRAINT: ;;   Every sublist will contain at least one number, and all ;;   numbers are >= 0. (check-expect (largest empty) empty) (check-expect (largest (list (list 1)                              (list 2)))               (list 1 2)) (check-expect (largest (list (list 1 3 7)                              (list 5 2 4)                              (list 4 2 5 9 1 5)))               (list 7 5 9)) ;; *** As a reminder, you must not edit anything above this line!!! *** ;; *** You may add tests below here.                                *** (@template-origin fn-composition use-abstract-fn) (define (largest lolon)   (map (lambda (lon)          (foldr max 0 lon))        lolon))

 

 

 #牛客AI配图神器#

Java-solution

public static Boolean drawRectanguleIntervalByBottomBlank(int stepInts,BottomBlank bottomBlank){     if (stepInts<0 || stepInts>9){         return null;     }     if (bottomBlank==null){         return null;     }     ArrayList<Ractangle> ractangleArrayList = new ArrayList<>();     for (int i = 0; i < stepInts; i++) {         Ractangle ractangle = new Ractangle();         ractangle.setId(UUID.randomUUID().toString());         ractangle.setName("blueRactangle"+i);         ractangle.setWidth(1);         ractangle.setHeight(i+1);         ractangleArrayList.add(ractangle);     }     ArrayList<BottomBlank> bottomBlankArrayList = new ArrayList<>();     for (int i = 0; i < stepInts; i++) {         BottomBlank bottomBlank1 = new BottomBlank();         bottomBlank1.setId(UUID.randomUUID().toString());         bottomBlankArrayList.add(bottomBlank1);     }         for (int i = 0; i < stepInts; i++) {         System.out.println(ractangleArrayList.get(i).toString());         System.out.println(bottomBlankArrayList.get(i).toString());     }     return true; }

 

enum Color{     BLUE("0001","blue")         ,WHITE("0002","white");     private String key;     private String val;     Color(String key, String val){         this.key = key;         this.val = val;     }     public String getKey() {         return key;     }     public String getVal() {         return val;     } } class Ractangle{     private String id;     private String name;     private Integer width;     private Integer height;     private String ractangleColor=Color.BLUE.getVal();     public String getId() {         return id;     }     public void setId(String id) {         this.id = id;     }     public String getName() {         return name;     }     public void setName(String name) {         this.name = name;     }     public Integer getWidth() {         return width;     }     public void setWidth(Integer width) {         this.width = width;     }     public Integer getHeight() {         return height;     }     public void setHeight(Integer height) {         this.height = height;     }     public String getRactangleColor() {         return ractangleColor;     }     public void setRactangleColor(String ractangleColor) {         this.ractangleColor = ractangleColor;     }     @Override     public String toString() {         return "Ractangle{" +                 "id='" + id + '\'' +                 ", name='" + name + '\'' +                 ", width=" + width +                 ", height=" + height +                 ", ractangleColor='" + ractangleColor + '\'' +                 '}';     } } class BottomBlank{     private String id;     private final String BottomBlankColor=Color.WHITE.getVal();     private Integer BottomBlankWidth=1;     private Integer BottomBlankHeight=10;     private final Integer BootomBlankDemesion=2;     public String getId() {         return id;     }     public void setId(String id) {         this.id = id;     }     public String getBottomBlankColor() {         return BottomBlankColor;     }     public Integer getBottomBlankWidth() {         return BottomBlankWidth;     }     public void setBottomBlankWidth(Integer bottomBlankWidth) {         BottomBlankWidth = bottomBlankWidth;     }     public Integer getBottomBlankHeight() {         return BottomBlankHeight;     }     public void setBottomBlankHeight(Integer bottomBlankHeight) {         BottomBlankHeight = bottomBlankHeight;     }     public Integer getBootomBlankDemesion() {         return BootomBlankDemesion;     }     @Override     public String toString() {         return "BottomBlank{" +                 "id='" + id + '\'' +                 ", BottomBlankColor='" + BottomBlankColor + '\'' +                 ", BottomBlankWidth=" + BottomBlankWidth +                 ", BottomBlankHeight=" + BottomBlankHeight +                 ", BootomBlankDemesion=" + BootomBlankDemesion +                 '}';     } }

 

 

#考研对你找工作产生了哪些影响?##打杂的实习你会去吗?##牛客创作赏金赛##机械只有读研才有出路吗?##面试被问第一学历差时该怎么回答#
Java技术 文章被收录于专栏

JavaEE技术 编程开发经验 企业通用技术

全部评论

相关推荐

菠落蜜:这个是系统自动投的,不是hr主动打招呼。更抽象的还有ai回复
我的秋招日记
点赞 评论 收藏
分享
10-23 16:33
门头沟学院 Java
本人某中9本科,成绩中等,目前没科研没实习,目前后端学到了javaWeb,开始没定好方向,在学国外课程,走工程路线起步有点晚了,到这个时间点了还在学JavaWeb,顿感迷茫,不知道是坚持走下去还是寒假去准备考研。考研这个路弄得我还是心痒痒的,因为从众考研的人也不在少数,所以会有这方面的心理安慰吧,就是“不行我可以去考研啊”,而且意味着三年的缓冲,为了复试还有积攒经验美化简历,其实现在也可以去申入实验室打杂;就业可能意味着多些工作经验,工程岗应该到后面还是经验大于学历?还是有点迷茫了,求助好心人有无路线启发
千千倩倩:同27给点建议,现在这个时间点可以快速看完外卖和点评,不用跟着敲,但一定要在看的时候总结每个部分的整个业务流程,对其中的实现有一个大概的印象。然后直接开始看八股,刷算法。八股和算法最好还是在项目学习中穿插着看。如果计算机基础,算法这些基础好,加上每天刻苦学习,两周可以达到勉强能面试的水平,到时候就直接海投中小厂,在约面和面试的过程中不断巩固知识。没找到实习也没关系,就当积累经验。再沉淀一波直接明年三月开始投暑期,毕竟是9本,总是有面试机会的,只要你这三个月不懈怠,面试发挥得一定不错,只要拿到一个中,大厂暑期实习,秋招就有竞争力了。总得而言,现在还有机会,但是时间非常紧张,需要你结合自己情况考虑,共勉
你会选择考研还是直接就业
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务