团队成员:陈淑筠、杨家安、陈曦

团队选题:小学四则运算APP

第二次冲刺阶段时间:11.29~12.09

本次发布的是判断题的部分代码

panduanset.java

import com.example.calculator.R;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.RadioGroup;
import android.widget.RadioGroup.OnCheckedChangeListener;
import android.widget.TextView; public class panduanset extends Activity {
private TextView panduannumber;
private RadioGroup panduanRG;
private int i,g;
private Button panduanxunlian;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_panduan_set);
panduannumber=(TextView)findViewById(R.id.panduannumber);
panduanRG=(RadioGroup)findViewById(R.id.panduangroup);
panduanxunlian=(Button)findViewById(R.id.panduanxunlian);
panduanRG.setOnCheckedChangeListener(new OnCheckedChangeListener() { @Override
public void onCheckedChanged(RadioGroup arg0, int arg1) {
// TODO Auto-generated method stub
i=arg1;
}
});
panduanxunlian.setOnClickListener(new OnClickListener() { @Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
g=Integer.valueOf(panduannumber.getText().toString());
Intent intent=new Intent();
Bundle bundle=new Bundle();
bundle.putInt("panduansuanfa", i);
bundle.putInt("panduanshumu",g);
intent.setClass(panduanset.this,panduanActivity.class);
intent.putExtras(bundle);
startActivity(intent);
}
});
} @Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
} }

pandaunactivtity.java

import java.util.Random;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView; public class panduanActivity extends Activity{
private Button next1;
private Button result1;
private TextView timu1;
private int index,i;
private int k,j,l,sum;
private char a;
private final Random num1=new Random();
private final Random num2=new Random();
private final Random r = new Random();
private char[] ch = {'+','-','*','/'};
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_panduan);
Bundle bundle=getIntent().getExtras();
index=bundle.getInt("panduansuanfa");
a=ch[index];
i=bundle.getInt("panduanshumu");
String c=String.valueOf(num1.nextInt());
String b=String.valueOf(num2.nextInt());
String g=String.valueOf(r.nextInt());
k=Integer.valueOf(g);
l=Integer.valueOf(c);
j=Integer.valueOf(b);
String d=String.valueOf(a);
switch(index){
case :
sum=l+j;
break;
case :
sum=l-j;
break;
case :
sum=l*j;
break;
case :
sum=l/j;
break;
}
switch(k){
case :
timu1.setText(c+d+b+"="+String.valueOf(sum));
break;
case :
timu1.setText(c+d+b+"="+String.valueOf(sum+));
break;
case :
timu1.setText(c+d+b+"="+String.valueOf(sum+));
default:
break;
}
} @Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
} }

小学四则运算APP 第二阶段冲刺-第三天的更多相关文章

  1. 小学四则运算APP 第二阶段冲刺-第五天

    团队成员:陈淑筠.杨家安.陈曦 团队选题:小学四则运算APP 第二次冲刺阶段时间:11.29~12.09 本次发布的是判断题代码,已经实现部分功能,,但是美中不足的是判断错误 panduanset.j ...

  2. 小学四则运算APP 第二阶段冲刺

    第一阶段实现最基本的四则运算计算,最原始的所以还没有美化 xml文件     <LinearLayout xmlns:android="http://schemas.android.c ...

  3. 小学四则运算APP 第一个冲刺阶段 第三天

    团队成员:陈淑筠.杨家安.陈曦 团队选题:小学四则运算APP 第一次冲刺阶段时间:11.17~11.27 本次发布是在与团队成员解决了昨天问题的基础上,再增加了几个界面,增加了一些功能,修改与增加的代 ...

  4. 小学四则运算APP 第一个冲刺阶段 第四天

    团队成员:陈淑筠.杨家安.陈曦 团队选题:小学四则运算APP 第一次冲刺阶段时间:11.17~11.27 本次发布我们增加了CalculatorsActivity.java.YunsuanActivi ...

  5. 小学四则运算APP 第一个冲刺 第八天

    团队成员:陈淑筠.杨家安.陈曦 团队选题:小学四则运算APP 第一次冲刺阶段时间:11.17~11.27 本次发布的是还未完成的功能二(选择题): ChoiceActivity.java: packa ...

  6. 小学四则运算APP 第一个冲刺 第七天

    团队成员:陈淑筠.杨家安.陈曦 团队选题:小学四则运算APP 第一次冲刺阶段时间:11.17~11.27 本次发布的是完成的功能一: 程序代码: MainActivity代码: import andr ...

  7. 小学四则运算APP 第一个冲刺阶段 第六天

    团队成员:陈淑筠.杨家安.陈曦 团队选题:小学四则运算APP 第一次冲刺阶段时间:11.17~11.27 本次发布的是重新排列整齐ResultActivity的布局代码activity_result. ...

  8. 小学四则运算APP 第一个冲刺阶段 第五天

    团队成员:陈淑筠.杨家安.陈曦 团队选题:小学四则运算APP 第一次冲刺阶段时间:11.17~11.27 本次发布的是实现练习功能的成功 代码: public class CalculatorActi ...

  9. 小学四则运算APP 第一阶段冲刺 第二天-补

    团队成员:陈淑筠.杨家安.陈曦 团队选题:小学四则运算APP 第一次冲刺阶段时间:11.17~11.27 本次发布已经解决上次问题,问题是写程序逻辑错误,问题已经修改!我们还增加两个模块的面板设置,如 ...

随机推荐

  1. css设置文字不能选中状态

    高版本浏览器的处理方式 -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-u ...

  2. 控件_CheckBox(多选按钮)

    import android.os.Bundle; import android.app.Activity; import android.widget.CheckBox; import androi ...

  3. cf C. Finite or not? 数论

    You are given several queries. Each query consists of three integers pp, qq and bb. You need to answ ...

  4. swift面向协议编程

    https://www.technotification.com/2018/08/protocol-oriented-programming-swift.html https://www.toptal ...

  5. Scala 上下文界定

    上下文界定的类型参数形式为T:M的形式,其中M是一个泛型,这种形式要求存在一个M[T]类型的隐式值: /** * 上下文界定 */ @Test def testOrdering_Class_Conte ...

  6. Springboot入门程序

    springboot简化之前的很多xml文件,不需要大量配置xml文件,没有很多xml文件是多么的愉快 下面进入正题,演示简单的入门程序,虽然简单,但足以振奋初学者们 我新建的工程名叫hello,大家 ...

  7. Html5 手机端网页

    <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <m ...

  8. C. K-Dominant Character

    给出一个字母串,k满足:长度至少为k的字串一定包含某字母c,求最小的k 一个数组记录每个字母上一次出现的位置,用来计算另一个数组:记录每个字母与其相邻的相同字母的最大距离(设0和len两个位置一定有相 ...

  9. Python崛起:“人生苦短,我用Python”并非一句戏言

      这些年,编程语言的发展进程很快,在商业公司.开源社区两股力量的共同推动下,涌现出诸如Go.Swift这类后起之秀,其中最为耀眼的是Python.   在这里还是要推荐下我自己建的Python开发学 ...

  10. sublime text3作为php开发IDE

    phpstorm开发有时候太占内存,会发生卡顿.虽然还是更喜欢用这个IDE哈哈. 一个也很强大的编辑器sublime text3,作为偶尔的替代也很给力.这个内存占用会小不少. 官网下载sublime ...