-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技术 编程开发经验 企业通用技术

全部评论

相关推荐

水墨不写bug:疑似没有上过大学
点赞 评论 收藏
分享
头像
06-11 23:35
美团_测试开发
&nbsp;&nbsp;今天主要说说我之前实习那会是怎么过来的以及大家以后做实习生了有什么建议给大家。入职一年不到就要开始下楼去接我的实习生了,之前虽然也带过一些实习生啥的但是主要是别人教的,我主要就是带带他们测需求或者写一些工具啥的,没有归属感。我实习那会:煮包我是大三那会开始实习的,当时是在快手,我在牛客的第一篇帖子就是23年那会拿到快手的offer,作为双非二本的我还是很开心的。首先实习第一天就是配环境其它不用做什么有时间可以再熟悉一下业务啥的。公司招实习生的目的主要是做一些杂活技术含量一般要求不高,除非是校招实习拿到offer再去实习,这种一般会好好培养或者做一些技术含量大的工作。普通实习生一般要是想学东西就得靠自己去看看公司的课或者相关的文档啥的,学习进步的过程往往是痛苦的,煮包我当然是吃不了一点苦的那会,所以快手实习两个月基本啥也不会就混了个实习经历,再后来痛定思痛感觉再不学一些东西面试都没东西讲了,所以就详细了解了一下业务,主动申请写写自动化,然后当时还学了kafka,我的导师晚上化作面试官对我提问。真的很不错,再后来就是大四下因为学校要求所以过完年就去美团提前实习了,因为是我主动要去的,所以当时就没啥工作基本都在摸鱼,每天就是逛我们内部的话题看看相亲贴啥的,就这样两个月也没测过需求就学了学工具基本没有成长吧,也是为我下半年入职埋了雷吧,出来混迟早要还的。建议:如果你是大三或者研二这种的,我的建议是可以努努力争取转正啥的,或者多去学学公司的内部资料,特别是基础一般的一定要乘着这个机会去学,文档没有权限就大胆的申请,私信求大哥大姐们给审批一个权限。“哥,我是刚来的实习生可以辛苦给审批个权限吗,我要学一下这个东西”。这个是我常用的话术,一般人都不会拒绝的。如果是大四考研上岸的这种,俗称“大爷”,这种可以随时跑路,干的不喜欢跑就完事了。之前我就遇到个,项目干了一半了跑了,然后我加班好几天才给补救回来,一开始信誓旦旦的给我说我干完了才会走,结果发现不好搞就直接跑路了,我真的丢了呀。我相信我的新实习生不会这样的,我要励志成为一个好mt。最后:有个好的导师真的很重要,可以少走很多的弯路,也希望大家能拿到满意的offer遇到很好的导师&nbsp;&nbsp;
宏夏c:我实习时候的mentor已经跳槽了
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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