0% found this document useful (0 votes)
11 views3 pages

APCSP Performance Task Component A

yolo

Uploaded by

pomstick0
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views3 pages

APCSP Performance Task Component A

yolo

Uploaded by

pomstick0
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

var BMI = [];

var username;

var age;

var weight;

var height;

onEvent("get_start", "click", function() {

setScreen("Input");

});

var ListUser = [];

var ListAge = [];

var ListWeight = [];

var ListHeight = [];

function Insertperson(u_name, u_age, u_weight, u_height) {

insertItem(ListUser, ListUser.length, u_name);

insertItem(ListAge, ListAge.length, u_age);

insertItem(ListWeight, ListWeight.length, u_weight);

insertItem(ListHeight, ListHeight.length, u_height);

function ShowUser() {

show_User = "";

show_Age = "";

for (var i = 0; i < ListUser.length; i++) {

show_User = (show_User + "Username: " + ListUser[i]) + "\n";

show_User = (show_User + "Age: " + ListAge[i]) + "\n";


show_User = show_User + "Weight: " + ListWeight[i] + "\n";

show_User = show_User + "Height: " + ListHeight[i] + "\n" + "\n";

setText("ArrayList", show_User + " " + show_Age);

}}

function BMICalculator(bmiUser, bmiAge, bmiWeight, bmiHeight) {

var show_BMI = "";

setScreen("Result");

for (var i = 0; i < bmiUser.length; i++) {

show_BMI = ((show_BMI + "Username: ") + bmiUser[i]) + "\n";

show_BMI = ((show_BMI + "Age: ") + bmiAge[i]) + "\n";

show_BMI = (show_BMI + "Weight: ") + bmiWeight[i] + "\n";

show_BMI = (show_BMI + "Height: ") + bmiHeight[i] + "\n";

var new_Height = bmiHeight[i] / 100;

var BMI = bmiWeight[i] / Math.pow(new_Height, 2);

var BMI = [];

var username;

var age;

var weight;

var height;

onEvent("get_start", "click", function() {

setScreen("Input");

});

var ListUser = [];

var ListAge = [];

var ListWeight = [];

var ListHeight = [];


function Insertperson(u_name, u_age, u_weight, u_height) {

insertItem(ListUser, ListUser.length, u_name);

insertItem(ListAge, ListAge.length, u_age);

insertItem(ListWeight, ListWeight.length, u_weight);

insertItem(ListHeight, ListHeight.length, u_height);

function ShowUser() {

show_User = "";

show_Age = "";

for (var i = 0; i < ListUser.length; i++) {

show_User = (show_User + "Username: " + ListUser[i]) + "\n";

show_User = (show_User + "Age: " + ListAge[i]) + "\n";

show_User = show_User + "Weight: " + ListWeight[i] + "\n";

show_User = show_User + "Height: " + ListHeight[i] + "\n" + "\n";

setText("ArrayList", show_User + " " + show_Age);

}}

function BMICalculator(bmiUser, bmiAge, bmiWeight, bmiHeight) {

var show_BMI = "";

setScreen("Result");

for (var i = 0; i < bmiUser.length; i++) {

show_BMI = ((show_BMI + "Username: ") + bmiUser[i]) + "\n";

show_BMI = ((show_BMI + "Age: ") + bmiAge[i]) + "\n";

show_BMI = (show_BMI + "Weight: ") + bmiWeight[i] + "\n";

show_BMI = (show_BMI + "Height: ") + bmiHeight[i] + "\n";

var new_Height = bmiHeight[i] / 100;

You might also like