Computers and Technology, 16.04.2020 02:02 leahandmaryssa
The goal of this project is to create a Food Diary. This diary should contain breakfast, lunch, dinner and Snacks that you consume during the day. The user should be able to enter their food items and save it as a csv file. The user should be able to keep appending to the file.
This is what I have so far but I'm not sure where to close my scanner:
import java. io. File;
import java. io. FileNotFoundException;
import java. io. PrintWriter;
import java. util. Scanner;
public class App {
public static void main(String[] args) throws FileNotFoundException {
PrintWriter pw = new PrintWriter(new File("test. csv"));
StringBuilder sb = new StringBuilder();
sb. append("Date");
sb. append(',');
sb. append("FoodTime");
sb. append(',');
sb. append("FoodItem");
sb. append(',');
sb. append("Calories");
sb. append('\n');
int exit;
do {
Scanner sc = new Scanner(System. in);
System. out. println("Date : ");
String Date = sc. next();
System. out. println("Meal Time: ");
String FoodTime = sc. next();
System. out. println("Food Item : ");
String FoodItem = sc. next();
System. out. println("Calories : ");
String Calories = sc. next();
sb. append(Date);
sb. append(',');
sb. append(FoodTime);
sb. append(',');
sb. append(FoodItem);
sb. append(',');
sb. append(Calories);
sb. append('\n');
pw. write(sb. toString());
System. out. println("Please enter 0 to exit, 1 to continue : ");
exit = sc. nextInt();
} while (exit != 0);
System. out. println("done!");
}
}
Answers: 1
Computers and Technology, 21.06.2019 20:40, cmflores3245
Convert and simplify the following sentences to conjunctive normal form (cnf): (a) (p → (q → r)) → (p → (r → q)) (b) (p ∧ q) → (¬p ↔ q) (c) ((p → q) ∧ ¬q) → ¬p
Answers: 3
Computers and Technology, 23.06.2019 18:30, bsept1018
Report all segments of identity by descent longer than 20 polymorphisms between pairs of individuals in the following cohort of 15 individuals across 49 polymorphisms: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 numeric input 2 points possible (graded) you have 2 attempts to complete the assignment below. for example if the sequence is "bcd", which occurs in "abcdef" , the starting point would be 2 (b), and the finishing point would be 4(d). individuals 7,10 between positions
Answers: 1
The goal of this project is to create a Food Diary. This diary should contain breakfast, lunch, dinn...
Mathematics, 10.11.2020 15:40
History, 10.11.2020 15:40
English, 10.11.2020 15:40
Mathematics, 10.11.2020 15:40
Mathematics, 10.11.2020 15:40
Biology, 10.11.2020 15:40
Geography, 10.11.2020 15:40