这道题怎么做这题

后使用快捷导航没有帐号?
只需一步,快速开始
请完成以下验证码
请完成以下验证码
主题帖子荣誉
查看: 470|回复: 3
& 累计签到:86 天连续签到:1 天
马上注册加入鱼C,享用更多服务吧^_^
才可以下载或查看,没有帐号?
写出一个类Computer,并由该类做基类派生出子类Notebook和Desktop。其中Computer类具有cpu、ram两个成员变量,分别为String类型、整型,且具有公有的getRam成员方法,用于返回ram变量的值。 Notebook类具有成员变量factory, 为String类型,Desktop类具有comclass成员变量, 为String类型。
& 累计签到:143 天连续签到:1 天
&&&
写出一个类Computer,并由该类做基类派生出子类Notebook和Desktop。
其中Computer类具有cpu、ram两个成员变量,分别为String类型、整型,且
具有公有的getRam成员方法,用于返回ram变量的值。 Notebook类具有成员
变量factory, 为String类型,Desktop类具有comclass成员变量, 为String
类型。
&&&
class Computer():
& & &&&通用的计算机类型&&&
& &
& & def __init__(self, cpu_model, ram_capacity):
& && &&&
& && &&&self.cpu_model = cpu_model
& && &&&self.ram_capacity = ram_capacity
& &
& & def getRam(self):
& && &&&&&&用于返回计算机的内存容量&&&
& && &&&
& && &&&return self.ram_capacity
& &
& & def getCpu(self):
& && &&&&&&用于返回计算机cpu型号和参数&&&
& && &&&
& && &&&cpu_dict = {
& && && && && & &Core i3&:&1.40GHz&,
& && && && && & &Core i5&:&3.20GHz&,
& && && && && & &Core i7&:&3.40GHz&,
& && && && && & }
& && &&&
& && &&&cpu_model_list = []
& && &&&
& && &&&for per_cpu in cpu_dict.keys():
& && && && &cpu_model_list.append(per_cpu)
& && &&&
& && &&&if self.cpu_model in cpu_model_list:
& && && && &cpu_information = &您的计算机CPU型号为 &&& & + self.cpu_model
& && && && &cpu_information += &\n-- 主频参数 -- :& + cpu_dict[self.cpu_model]
& && && && &print(cpu_information)
& && &&&else:
& && && && &cpu_information = &您的计算机CPU型号为 &&& & + self.cpu_model
& && && && &cpu_information += &\n-- 主频参数 -- :暂无&
& && && && &print(cpu_information)
class NoteBook(Computer):
& & &&&笔记本电脑的类继承自通用计算机类&&&
& &
& & def __init__(self, cpu_model, ram_capacity):
& && &&&
& && &&&super().__init__(cpu_model, ram_capacity)
& && &&&self.factory = &DELL&
& &
& & def set_factory(self, factory):
& && &&&
& && &&&self.factory = factory
& && &&&print(&您的电脑生产厂家是 &&& & + self.factory)
& && &&&
class DeskTop(Computer):
& & &&&台式电脑的类继承自通用计算机类&&&
& &
& & def __init__(self, cpu_model, ram_capacity):
& && &&&
& && &&&super().__init__(cpu_model, ram_capacity)
& && &&&self.other = NoteBook(cpu_model, ram_capacity)复制代码
Java我不会,用Python写了一个,你看看.....哈哈哈哈
& 累计签到:1 天连续签到:1 天
package com.
* Created by Andy_Liu on .
//写出一个类Computer,并由该类做基类派生出子类Notebook和Desktop。
// 其中Computer类具有cpu、ram两个成员变量,分别为String类型、整型,且具有公有的getRam成员方法,用于返回ram变量的值。
// Notebook类具有成员变量factory, 为String类型,Desktop类具有comclass成员变量, 为String类型。
public class Computer {
& & private S
& & private I
& & public Integer getRam() {
class Desktop extends Computer {
& & private S
class Notebook extends Computer {
& & private S
& 尚未签到
小甲鱼强烈推荐
给我一节课的时间,帮你从繁琐的工作中解脱出来!
- - - - - - - - - - - -
极客Python,新课程!!
特效不会给你基本工资,但却能让你升职加薪
- - - - - - - - - - - -
有备无患,念念不忘
移动客户端下载(未启用)
微信公众号
Powered by
Copyright &
&&& All Rights Reserved.(元气满满李云龙)
(我超凶的!)
(风的余温)
(疯狂突突突突)
第三方登录:(自然避孕法张燕)
(偷走云朵的袖子)
第三方登录:(今年冬天有点冷)
第三方登录:怎么做这题?_百度知道
怎么做这题?
我有更好的答案
y=2x²+3,画出函数图象,根据图象解题。
然后解一下
好的,请稍等
我等下就要知道
抱歉,我不知道怎么用电脑绘制函数,您还是另找别人吧。
你解一下,然后发给我
为您推荐:
其他类似问题
您可能关注的内容
换一换
回答问题,赢新手礼包
个人、企业类
违法有害信息,请在下方选择后提交
色情、暴力
我们会通过消息、邮箱等方式尽快将举报结果通知您。}

我要回帖

更多关于 这题怎么做 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信