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

全部评论

相关推荐

Tom哥981:让我来压力你!!!: 这份简历看着“技术词堆得满”,实则是“虚胖没干货”,槽点一抓一大把: 1. **项目描述是“技术名词报菜名”,没半分自己的实际价值** 不管是IntelliDoc还是人人探店,全是堆Redis、Elasticsearch、RAG这些时髦词,但你到底干了啥?“基于Redis Bitmap管理分片”是你写了核心逻辑还是只调用了API?“QPS提升至1500”是你独立压测优化的,还是团队成果你蹭着写?全程没“我负责XX模块”“解决了XX具体问题”,纯把技术文档里的术语扒下来凑字数,看着像“知道名词但没实际动手”的实习生抄的。 2. **短项目塞满超纲技术点,可信度直接***** IntelliDoc就干了5个月,又是RAG又是大模型流式响应又是RBAC权限,这堆活儿正经团队分工干都得小半年,你一个后端开发5个月能吃透这么多?明显是把能想到的技术全往里面塞,生怕别人知道你实际只做了个文件上传——这种“技术堆砌式造假”,面试官一眼就能看出水分。 3. **技能栏是“模糊词混子集合”,没半点硬核度** “熟悉HashMap底层”“了解JVM内存模型”——“熟悉”是能手写扩容逻辑?“了解”是能排查GC问题?全是模棱两可的词,既没对应项目里的实践,也没体现深度,等于白写;项目里用了Elasticsearch的KNN检索,技能栏里提都没提具体掌握程度,明显是“用过但不懂”的硬凑。 4. **教育背景和自我评价全是“无效信息垃圾”** GPA前10%这么好的牌,只列“Java程序设计”这种基础课,分布式、微服务这些后端核心课提都不提,白瞎了专业优势;自我评价那堆“积极认真、细心负责”,是从招聘网站抄的模板吧?没有任何和项目挂钩的具体事例,比如“解决过XX bug”“优化过XX性能”,纯废话,看完等于没看。 总结:这简历是“技术名词缝合怪+自我感动式凑数”,看着像“背了后端技术栈名词的应届生”,实则没干货、没重点、没可信度——面试官扫30秒就会丢一边,因为连“你能干嘛”都没说清楚。
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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